Various fixes

* Add autoload cookies
* Use standard header structure, including copyright & licence
* Format parens idiomatically
* Eliminate byte-compilation warnings