Make API modules global.

Renamed 'app' to 'engine' in the global table.