Adjust the set of functions.
Lots of cleanup, comments and refactoring.
added a .gitignore.