JS wrap, better comments

Fixes #953 and better explains the routing inline.