Get basic working bookmarklet and refactor API into core