Now correctly closes connections.
Also correctly sets MIMEs for javascript and JSON.