Omit redundant 'px' suffix from dimension when value is zero.

This reduces the generated CSS's size a little.
Fix statement termination issues (commas and semicolons).
Remove double-whitespace in CSS generation.
Potentially reduce CSS size by setting default dimensions on base sprite class.

 Previously the image dimension would be set on the top-level CSS rule (eg: .sprite) if all images had the same dimension. This modification causes this defaulting to occur if more than one image has the same dimension. This is applied to height and width separately.

 This was motivated by a test set of images (the famfamfam flag icons [1]) from which four of the 249 images have different dimensions to the rest.

 Feature discussed on Stack Overflow [2].

 [1] http://www.famfamfam.com/archive/flag-icons-released/
 [2] http://stackoverflow.com/a/4185556/24874
Replace accidental global vars with locals.
Remove unused vars.