Add in support for seeded random numbers

This adds support for seeded random numbers (userful for reproduceable results) and also the ability to sort arbitrary arrays