Added comments, organized packages, minor refactoring.