Added cache, refactored db, added exception classes, added some tests;Things are brokenz, need teh fixing