JavaScript term-wise polynomial function string parser and plotter