[DS-1008] Encapsulate AT DB Connection and clean up

    - Factor out Mongo connection into its own class
    - Refactored ugly multiple if statements into hash
    - Remove unneeded JSON parsing