MAINT: lib: Use a consistent PEP8-compliant import style in twodim_base.py and tests/test_twodim_base.py.  Also make a couple more PEP8 tweaks.