Still working on unit tests some work left undone.

Change-Id: I4840b00981f0d1144232236dbe9d114c74ea547c
Reviewed-on: http://www.matthewh.me/gerrit/10
Reviewed-by: Matthew Hoggan <matthew.hoggan@matthewh.me>
Tested-by: Matthew Hoggan <matthew.hoggan@matthewh.me>