Gateway should be singleton, not a prototype

This is the culprit of ITs being way too slow (it is basically the repo creation that takes minutes in ITs!): this object is created for every repository instance (and JRuby ScriptContainer is very very heavyweight). I think this is a mistake, that several script containers are created.

Still, according to Kristian, there is some change needed, as state is kept in case of hosted layout or such.

This change lessens Ruby ITs execution a lot (on CI the modern0 shard executes in 43 minutes, instead of 96 minutes without this change).

CI
http://bamboo.s/browse/NX-OSSF311-1