move off lots of JS cruft into shared folder provided by core