Added tests for scriptResolver + fixed bugs and made code improvement