Implement insertion sort and test cases.