Mongo id fixes

Fixes a few issues involving mongodb

Closes #39 
Closes #43

As you say, Mongo is much better with the query, so I'm using the warning for the date entries themselves, such as to date being before the from date, and invalid dates.