2.0

Complete rewrite of functionality.py to be much cleaner.