Complete the refactor.

Finish refactoring the code and write spec tests. Update version number and run through linter.