Join Optimizer Draft

Will finish implementing soon.