cleanup

- move password handling into a single file
- move db init/open functions into a single file