prevent assets from being registered multiple times

JavaScript and CSS registrations are now stored inside a Set and a
Hash, respectively, to ensure that no duplicates are created.
Merge pull request #2139 from Daxter/bugfix/1845-asset-registration

[1845] prevent assets from being registered multiple times