Moved database connection setup into magellan.py module. needs testing