More work

Better db handling, got rid of a "You're leaking connections" error.
Some more print statements.