Refactoring and re-work for use in Islandora 7.