Jkarni/type safe links

Just the mkLink function (with tests) - no QQ for it yet.