Merge pull request #4 from jone/encoding

Fix setting portrait by using utf-8.
Create events on registration and login.