Moves the textinplace instantiations into a separate Javascript file, which fixes breakage caused by apostrophes in element names.
Ready for results fixing.