Fixed sorting to allow it to take functions represented as standard functions and overloaded functions (overloaded functions were causing an invalid typecast error before).
Merge branch 'master' of github.com:cwi-swat/rascal