fixed mongodb, added initial debugging support