Refactored into standalone directive
Result param added so controller can access resulting data uri.
Demo page shows instructions and resulting image.