caching avatars using urls, not userId

Closes #349
storing avatars in a separate folder for user

All avatars for a user are stored in a separate folder with the
user id as the name. All files in that folder are deleted before
writing a new one if the avatar doesn't already exist in that folder.
This should solve the problem with the old avatars when
avatar url is changed.