Major cleanup; addition of THROW() and implementation of some less useful IDF requirements