Fix all but one JSHint error in cradle.js. Use strict mode

To improve code quality, the code should pass JSHint. I fixed all the errors with the exception of line 129. I'm not sure what the purpose of the promise line is, since the variable is not used anywhere in the code. I also switched on JSHint.