Merged dev/temp, and my current master.

This merge should include all changes so far.