Increase loadScripts timeout
Improve error handling.

Add an optional error function argument to the loadjs function