Cleaned up code for first release. Constants need to be configured, before the thing runs.