Use in-memory db for testing; and pep-8 fixes