Clean up code

There's no semantic changes here.  Just cleanup for the following thing:

* Whitespace
* Consistent Indentation
* Using app to prefix Photoshop methods
* Declaring vars at the top level instead of relying on implicit global declarations
* Replace with-statements

I can squash the commits some more if need be.  Lemme know what you think.