move base class to base.py

Signed-off-by: Stephen Gran <steve@lobefin.net>
more DRY

Signed-off-by: Stephen Gran <steve@lobefin.net>
defensive maneuvers

Signed-off-by: Stephen Gran <steve@lobefin.net>