implement toMongo [closes #14]