Refactoring some classes into traits.

Signed-off-by: Ben Corlett <bencorlett@me.com>