Sort workspace items by revised, newest first

 - Make sorting code python3 compatible
 - Add test