transform objects aren't considered empty

This is so compact() won't remove them.
Basic implementation of transform_sort()
Allow sorting on multiple variables