Restructured and organized the code a bit. Also added packages.