code review changes: used MW Html class to build script tags
added remembering selected sorting option