Core sorting logic moved in separate method so that it could be called directly

Core sorting logic moved in separate method so that it could be called directly from user code to do manual sorting without column clicks, method for removal of sortclicking behavior.