massive refactoring to create certain objects (cookiejar, nam, etc) at the point of use. Note: cookies are not saved; the 'open' builtin is missing after the NAM is destroyed (why?). Fixing...
bad parameter order in previous commit; parameter order is not standarized
It stores cookies now (via close_event). General cleanup.