Initial changes to run purely on javascript. Changes should be backwards compatible with implementations that don't use custom handlers.