Added tests for iframe resolver + bugfix and code refactoring