Contexts - minor improvements

An invocation of getBeanStore() usually involves ThreadLoca.get().
Therefore we should avoid unnecessary invocations if possible.