Add algorithm and test for stable_partition

Added algorithm and test for ```stable_partition``` and changed ```partition``` to use it for now. I am searching for a good implementation(swaps based?) for ```partition``` to take advantage of the fact that order of elements need not be preserved.