Some fixes and PEP8 to classes in cms/db