Rework code to be Java and Android friendly
Merge pull request #1 from tozny/initial-cleanup

Rework code to be Java and Android friendly