Refactoring so that the repository changesets are looped through as few times as possible.
Merge pull request #6 from tychofreeman/master

Started performance refactoring