Cleaned up code significantly.

Added API corner for Readme, added testdata python file to give test
data to work with.