Mysql database integration.

updated tests in place.