Pulled storage communication into its own object

Moved the database communication and storage routines into a separate object that will store and retrieve nonces and user keys.