Clean up JS scripts

Minimize the exposure of private functions. This ensures that calls are
only using a public API and avoids polluting the global namespace with
uzbl variables.