Handle UIAutomation and JSON better

UIAutomation uses non-standard `#import "/path/to/file.js"` statements.  This patch treats them similarly to shebang lines.

Sometimes it's nice to keep your JSON all on one line, eg.
```
coordinates = {x: 3, y: 5};
```

This patch avoids inserting lines if the original JSON expression didn't have them.