Add support for declarations, and more theories.