Implement reading byref variants.

This commit is licensed under MIT/X11.
Merge pull request #623 from madewokherd/byrefvariants

Implement reading byref variants.