Add truncate & truncateFromCenter with test

This should be better right now :smile: 
Same as this: `!separator ? "..." : separator`, which I think is easier to read.