Fixed memory corruption and added the number of items to the bottom of the RepositoryWindow

The main commit that you'll probably be interested in is 366e4ed which fixes a crash on startup caused by heap corruption.  The other commits add a label that displays the number of items at the bottom of the repository window.