move bookmarklet stuff to public folder, adapt to global scope. Still small errors.