Spatial plugin globals

this kind of think what you had in mind for #475 ? If yes I can write some tests.