Clean up the code to remove many unnecessary debug statements and unused code from original Android source