Moved block operations to separate functions;
Changed structure of filters based on http://www.html5rocks.com/en/tutorials/canvas/imagefilters/