JS: minor cleanups

- Stray printf's
- Remove names from anonymous functions which are unlikely
  to show on stack traces to reduce clutter