Implementing Aggregate Factory

This work is comprised of changes from both @simensen and @kelvinj and taking
into account a lot of discussion on IRC. Squashed 7 commits into one.