move listener to outside of engine for tests
add tests for engines, temporally.
Fix bug to return [] for nil input, and add specs
v1.0.3