Fixed wrong formating in customers.tpl
Added dynamic sorting
Made sorting libs global