Starting Rule Graph

Big refactor of existing behaviors. Started LayoutState class and
started working on the rules graph and some basic rules.