Alias support for double linked hasMany / Refactor how double linked associations are determined

This PR in general refactors how double linked associations work.
This enables users to again use N:M hasMany with aliases.