Returns a copy of the given selection.
The start and end position does not have to be ordered. If the start position is after the end, the positions are switched automatically.
The text positions are automatically fixed to be within bounds.