[Fixes #22] Setting undeclared attributes doesn't work and added tests

Fix as discussed in [the issue](https://github.com/octobercms/library/issues/22).

I'm happy to make any improvements to the tests you recommend. I wasn't sure a good way to test the [extensionData foreach](https://github.com/octobercms/library/blob/master/src/Extension/ExtendableTrait.php#L148), and I had problems getting the [parent code](https://github.com/octobercms/library/blob/master/src/Extension/ExtendableTrait.php#L155) to be show as being covered.