Make function resolving be data-driven.

This saves another 24k of built code.
Add whitespace in generated code after the enum strings.
Use self.target instead of mucking around with the filename.

This cleans things up for upcoming EGL support.