Update gems and update code to utilise some new gems
Broken some stuff out into classes. Starting to refactor.
[ci skip]