Moved the sorting logic to functions todo-ui.js.
Renamed the id of the main <ul>.
Minor refactoring.
Fixed bug in markCompleted. It was using a global variable i instead of a local one!
Added onCreateNewItem. It creates a generic new item on the server and, if successful, in the ui.
Added three functions uiSortByTitle, uiSortByPriority, uiSortByDate to manipulate ui elements.