Dataitem: clean up double sort/orderBy functions.
Mysql: clean up half-finished logging code.