Fix issues with dates in queries and late assigning of ids
Start use mocha for testing instead of vows