Introduce transactions

Moved emoticon parsing to JavaScript. Rework DatabaseWorker.cpp using
switch instead of shitload of if's. Comment stuff in DatabaseWorker,
QAvkonHelper and main.cpp. Also added some headers. I like headers.
Headers are nice. And look so professional.