[#1234] Attempt to break both module dependency and OO loops.
By using lazy import (accounts for dependnecy loop) and by moving
subclass references out of base class (accounts for OO loop; this is
strictly not necessary for dynamic language like Python, but OO loops
are paradigmatic errors).