Improvements to engine generator

Mainly to support polling on application sockets