Fix a bunch of issues, clean up keys and hashtables
Implement function autoloading