Lots of improvements, headers, documentation.