MDL-30106 forum: Added sort by and sort direction parameters to the ws get_posts

Upgraded tests also and fixed minor issues detected