Small changes to clean up webagg javascript code a bit.