Added dependencies loop detection

Also added multiple import detection.
Loop will throw an error, multiples will be ignored.