Switch to two pass compiler.

To fix some bugs with binding/directive application, the compiler now
makes a first pass to determine all directives to apply to a given
node. It then makes a second pass to compiler them.