Fixed issue with repos containing a single release

The original code didn't support repositories with a single release, and didn't add the first release to the changelog. 

Added a bit more efficiency (while loop vs. for) and array magic too!