Refactor definitions API to remove various factories, using direct object instantiation instead.