Consistent indentation and JS Lint

Inconsistent indentation was making this difficult to read in the Github interface and in text editors with different tabstops set.

Most lines were indented with tabs, but some were indented with spaces, I've changed them all to tabs.

`readBytes` was assigning to the global variable i, i.e. it was assigning to an undeclared variable.

`alertFrameworkVersion` was not terminated with a semicolon.