Improved db connection handling, fixed bugs
Added function to list users