licence: update licence
db/cli: remove sort functions
server: some cleanup
thread: cleanup
utils: cleanup
db: cleanup