Added more robust mongoose schemas and unit tests