Ensure the DOM attribute is updated when a resource name changes.

Progress on #25.
Merge pull request #158 from nicksay/cleanup-script-style

Ensure the DOM attribute is updated when a resource name changes.