Implement str.partition and add tests for it.