validation, pickle querying, basic unit tests, misc cleanups

haven't tried to abstract query methods much yet--let's talk about this after mongodb backend is working