Added handling of iuse functionality to the item factory. 

Also made mapgen code go through item factory to get templates, so json file entries are actually used here.