update $ref parsing to also pick-up references inside deeply nested schemas. TODO catch up on circular dependencies