Add missing tests for Container. Also, rework some of the internal behaviour and add handling of circular aliases.