Update capture script

Add serial number fetching, tested heater controls.
Factor out command arguemnt processing so image capture script can be
called from python code more easily.