Refactored plugins, splitting off shared and renaming context to directory

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