Abstract session access away in a class

This makes it easier to work with a clean session for unit tests and provides an interface that in the future can be used to create different session backends such as Memcache/APC/XDebug or DB

@Raydiation appframework probably needs some adjustments for this.

cc @karlitschek @bartv2 @DeepDiver1975 @MTGap