Refactor some gridfs ops, add moodle problem importer