core improvements

global sorting system and sorting bugfixes, prev and next post added