Real fix for Issue #7

The HTML with the replaced IDs was not making it to the output. Also, multiple duplicates still had issues. Should be resolved. Needs tests.
Merge pull request #22 from ktsashes/resource-gathering

Real fix for Issue #7