Patch and tests for issue #258

There is an ordering issue in the code in that when a new lwrp resource is encountered, the corresponding provider is blown away. (Along with the previously defined resource.)  This code changes that behavior such that the provider blows away a preexisting provider and a resource blows away a preexisting resource--and no more.

If you prefer these commits squashed, I can easily throw up a clean commit.  This history shows the evolution of the changes, which are far less than a git diff from the head might suggest.