Improve relation processing

Split the relations in to two groups, one for relations not involving
other relations, and the other for relations involving other relations.
This second group is then sorted and processed serially to ensure that
if a relation has a member (of type relation), that is present in the
input data, this member will be processed before the parent relation.
Note, that the current code will not deal elegantly with mutally
dependant relations.

Also added is human readable information regarding the time taken
(requiring a dependancy on the moment library).