Forgot to remove the debug message
Implement database detection

Thanks to http://stackoverflow.com/questions/10101602/ for a direction to look.
Fix #1