Add retina support, subdirectories and tidy code

This PR introduces:

- support for retina image generation through the srcset tag. Since support for this is minimal (only webkit nightly build at this point), img.srcset.js is used to support other browsers. 
- Code has been indented with non-tabs for sanity purposes and various bugs in templates have been fixed.
- Two layers of subdirectories based on md5 hash are now created inside the `img` directory, so that busy sites do not have folders with unwieldy amounts of images contained within them.

(Also this is my first ever PR on github so I could very well have messed something up somewhere!)