Moved repository to MwEntityCollection, updated for coding standards