Overhaul of docs

And some code consistency changes.