Singleton pattern for sorts in java backend

ready for review
is this supposed to be here?