Convert tabs to spaces; re-add package statements; cleanup for readability.