Brought in almost all the functionality, except for one-way and
two-way relations.