Fix resumption token bug, other bugs, coding standards.

Fixed the resumptions token issue laid out here: https://jira.duraspace.org/browse/ISLANDORA-907

Found a couple other bugs while I was fixing those so fixed those.

General coding standards cleanup and split out from the module file.