Add CORS support to multires.
Code cleanup with hints from JSHint.