Quite a refactor and some code cleanup. Co-authored-by: James Wells <jwells@dragonheim.net> Reviewed-on: #11 Co-authored-by: James Wells <jwells@noreply.localhost> Co-committed-by: James Wells <jwells@noreply.localhost>