Add support for declarations.

This somehow screwed up order of generated variables. There's no
error, but it looks very funky.