Added script recovering for script handlers
Fixed flawed if statements
Started work on exposed API for javascript vm