Fix avm1 setInterval

With tests of medium thoroughness!