Merge dev into master.

Tested all new features and current dev branch is stable.