Add unit tests for new functionality.

Also fix missing import for MySQL.