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

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