Cleanup including change to new, function-centered approach.
Added gitignore file.
First beta version of apply.py