Clean _previousMessages when iframe is detached

Fixes #42 

Warning! I didn't managed to run karma tests(even on master!). Getting timeout errors.