Remove some unnecessary cruft and improve test coverage for core.py