Sort class, with support for all types of sort