added main()
Merge pull request #14 from wplu/master

added main()
Merge pull request #17 from burbel/master

Numerous fixes, see CHANGES.txt for full list