Improved commenting

I’ve started tidying things up a little bit so it’s clearer what each
file does.