Add some common code to the directive interface, seperate some of the directives into independent classes

Signed-off-by: Josh Kilmer <srjek2@gmail.com>