Merging back to master.

Code relatively stable.