Added hooks preEmit and shouldEmit on actions.

Fixes #16
Fixing test that was really broken