Implement str.partition and add tests for it.
Implement str.rpartition and add tests for it.
str.(r)partition: factor our duplicate code.

Switch str.rpartition to search from left to right. Factor the
duplicate code into one helper function.