theory manual

I've cleaned up the formatting and a bunch of the text. I added some things and made the intro okay I think. Overall it's not great and still needs a lot of work for it to be useful. I'm going to see if Sebastian will help on this one. At this point it's at least okay and we could probably go forward with a PR with things in this state...