Rearrange to better support testing and start on adding MongoDB storage