Fixed bug that caused memory issues with convert_object_to_cpt_onomy_term() calling get_term_count() a lot. Also cleaned up a lot of code.