Refactored context specific stuff from SlugTreeRecord

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