Refactored context and isShared specific stuff from SlugTree base

Signed-off-by: Tom Wright <tom@inflatablecookie.com>