Made major changes. Add mongodb support and modularity