fix(server.js, other): Make db connection refresh every 10 minutes

Involved creating a connection class (can be set to refresh at whatever frequency)

Also cleaned up server.js and moved some code into other files.