Mostly made bucketsort more complete.

* also fixed the test, forgot to make a deep copy and the key-based
sorting was supposing a in-place sort.
* added buckets to bucketsort and made it work with keys as well
* added a small check if len(array) <= 1 to some functions
meant stable, not in-place