Clean compile, working through db interactions.

Done with a lot of the paper interactions.