Fix interface
Add headers
Implement about half of the references system