A variety of bugfixes, and better modularity
Updated .gitignore
Restructure module for distribution