Cleanup; spacing, removal of dead code, removal of dead constants, removal of global constants where reasonable