Mysql module

learned a couple of things today about node modules (thanks to @nickjanssen ). :)

this is not an exhaustive replacement, but replacing a couple of spots with the mysql as a module version.

also restructured main.js a little so that it didnt need to be wrapped in a function anymore