Fix issue in which sorting did not properly occur in android 2.x and phantomjs. Also changed _aggregateGroups to return and array of objects with key and module references as opposed to an object.