Updated to retrieve referenced rules
Started rewriting parse_file