[WIP] Codegen errors

- [x] Remove duplication of interfaces
- [x] Fix fatal errors
@Ocramius `array_map` is more fast, or is for another reason?