add mongoose and first steps at modularizing