Added `min`, `max`, `extract`, `length` functions. A few function categories fixes. 

I hope noone has yet started to work on these functions yet... otherwise it would be not so easy to merge :)