Fixed a load of typos and syntax errors and missing imports.  Android
version now compiles.