Added init command. Small fixes in erlang files. Added unit tests.