Refactored getLastCommit and added getCommitCount. Also improved error handling for getCommits.
Adding paging for commit history.