Fixed relationships not being namespaced when needed

Before creating a relationship it does a check to see if the main class is namespaced, and if so, appends the namespace to relationship, otherwise it leaves it as is.
Better namespace support for relationships