Merge pull request #6 from tychofreeman/master

Started performance refactoring
Revert "Merge pull request #6 from tychofreeman/master"

This reverts commit 256f2bd84f536e3a373815c367275106185c7daa, reversing
changes made to db17a2398bcfadedb6606d682a2aeee4380eb1d1.
Refactoring so that the repository changesets are looped through as few times as possible.