implemented sorting for collections

fixes #2
define a sort function property when constructed the Collection