Delete a few functions which are now unused

(and some code re-arranging).

Note, this pull request depends on #71 and I'll rebase this one after it is
merged.

 - [x] Merge #71