Resource class is not unit testable

Hal\Resource should not directly call `new Link` in the constructor.
Refactor class to use a factory method so the `Link` class can be
mocked.

Fixes #13