Merged Andrew's cam-py branch with my latest changes.

This works alright on both Windows and Linux (very quick checks only)