Initial push. Looks to be complete. Could do with a bit of cleanup in the main class.