Move barnsley JavaScript to its own file