initial version copied from kiln
first merge with changes made for Bastian and KEGG models in general
merged in changes made for loading KEGG models