Separated framework from database wrapping.

Major Refactoring, including separation into multiple files, and prepublish
scripts for generation of patched copies of mysql.js.
Added licence and .npmignore