More work on DataManager. Mostly works, but the implementation is a mess.