Optimise bokehjs (part 1)

This is first round of bokehjs optimisations. For now I tested this only on one example (scatter plot, 100k points), so bokehjs may be significantly broken.