Add ordering function for account

Split models and views into different files, finish the ordering
function for accounts page