Adds caching to inverseFor and implements look for inverses on the other side

This is horrible, how should I do this properly. @stefanpenner @mixonic