Refactor, bug fixes, and code cleanup; grass now grows