Issue 1459 avatar functional tests

This depends on #1512 (only the last commit is for this PR). This mocks out some client side functionality, like capturing webcam images and selecting a file from the filesystem.

Fixes #1459.
Fixes #1494.
maybe we can use the `avatar.jpg` image here? 
Otherwise we get these errors and we cannot rotate the image with canvas
![image](https://cloud.githubusercontent.com/assets/128755/3885633/02aa6af6-21c7-11e4-9562-1c5901e31ae0.png)