Big refactoring, separating storage from strategy. Closes #3.