[WIP] a couple of improvements to the js, no functional changes at all

we're setting the $container variable here