Refactor a whole bunch, get working with persistent 1.2
Add new module to cabal