Added JS support for user-selected port. Fixes #2.