Adding basic neighbor handling, fixing codegen.

TODO: Finish up neighbor loop.