Make master function easier to expand
Improved error handling

Began work for mdg:camera integration