1533 reformat adapter.js to be < 80 char/line

Done using eclipse's formatter, and then manually fixing some lines to comply with the style guide.

Some of the spacing, other line breaks changed, and )'s and }'s now align with the line containing the ( or {.