Refactored Database Manager

Added dependency injection (pass Connection in as constructor argument).