clean up api, file layout, and publish to npm as caret-position. Fixes #1