Reworked model file loader to support relations