Updated documentation and moved a few bits around.