Fixed a couple of issues with the dotcloud related code.
Externalised the emit code, and improved it to send back multiple hit types.