Move javascript callbacks and helpers to gem.