Remove a bunch of obsolete code
Update README.md and add a lot of comments