Refactoring: Minor cleanup
Write avatars to caches directory. Closes #323