Improve bookmarklet

This fixes #46 and allows the bookmarklet to work on non-standard-port URLs too.