Add test script to package.json
Guard against two ready calls
Add error handling