Added Loki database

* Added Loki database
* New method /app/ping shows how many users are online (bounty #14).
* Rewrite some code to comply with JSCS.