Refactor ontology-related modules.
Fix setup.py to not require numpy.