Added MIN aggregate function for relations.
- Initial working version. Still some issues though.