Make emoncms database agnostic

This patch series abstracts MYSQL out of emoncms and adds postgreSQL and SQLite support.

Some things where cleaned and cleared to make it work with all 3 databases.

Not tested and probably not working:
Update older databases, only creating was tested.
Only a small dataset, was available for testing (read, 5 - 10 manual entries) and thus get_data wasn't very testable.

SQLite currently has trouble dropping tables so while it should work, it doesn't on my test database. No memory optimizations have been done, see commit message for more details.

MYSQL support, while theoretically should be still 100% identical, needs to be tested of course, since I wasn't able to.