Allow custom sorting in exercise search. Fix some bugs.

This is now also named version 0.2 :-)