Support with aliases for double linked hasMany / Refactor how doubleLink is determined

Not ready for merge! Just creating PR so Travis can run my commits aswell.
Will update description and ping when ready for merge.