Finished initial implementation of Distributive
 Added the flattener and query rewriter abstract