Added std.algorithm.safeLess for safe signed/unsigned comparison

Added safeLess and rewrote min/max to use safeLess. This is useful for fixing signed/unsigned comparisons once 259 gets fixed.
Are these casts actually necessary? It's always best to avoid them if you can.