Reorganized packages, added legal, commented code