Wrap the datastore abstraction a bit tighter, cleans up some code and makes it more robust overall.