Changed loading of object scripts to keep index.html clean (states only).