Takes an array of objects and sorts them by an arbitrary number of common `string`, `number` or `Date` fields with control over direction and placement of `null` elements. Apart from the given fields it retains original order (stable sort). The original array will not be modified.
we only support numbers and strings, but stringifying dates prior to passing in work nicely. We could allow Date objects and stringify/create them internally though for a nicer devxp
we could move out the field checks into the outermost function for performance improvements, not sure if it really makes that much of a difference in practice though