Moved everything to a package, and many more changes