replaceUnique function, re-organize non-typeclass functions

replaceUnique needed functions (getJust) that were living in the base persistent
module. This caused circular imports. Taking things out of the base Persist module and putting them back in their respective Class made things work.