Bounding box calculation from input added.
Improved error handling. Also non-result output now goes to stderr.
Remove some unneeded variables from blob function.
Improved error handling
Output format now determined from options