adding protean tests for db.  Uses nose/unittest module. run with command: nosetests --verbose --nocapture db/tests_db.py.  Also, added db.flattener, db.unflattener decorators.