Circular Reference Checking

Hi Tony,

Here is my proposal for https://trackable.codeplex.com/workitem/38

Sweated really a lot to pass all tests except the last one which IMO was initially incorrect (see d1bae1b)

Please review every commit independently, considering the first five commits as sort of preparation work. And don't hesitate if despite the detailed commit messages you nevertheless get any questions.

Best regards,
AZ