router fix for canonical url's

The canonical url's are wrong. this patch fixes that
On function k2ParseRoute (for both advanced and normal) it adds some logic before executing
$vars['task'] = $segments[1];

I clean up the code also because there were a lot of repeating lines.

And apologies for messing around with the github. That's new for me...