Documentation

Okay, the long-awaited documentation branch is I think nearly done. Been a super long process but I've more or less documented the whole code base. 

I don't have time to work out the conflicts right now, but will merge this shortly.