README.md: Link to references in the introductory line.
Update descriptions, licence and copyright text.
Move commonly-used functions into the `lib` Python package.

Reformat and cleanup some code and try to enhance comments and style.
Move some code to the "experimental" branch.