First functional version. See README.md for changes.