Fixed postgresql locale and encoding.
Added lager logging framework.
Reworked ruil.erl.