add preview layer and toggle camera
Merge with recent changes and conform API to standard
Merge branch 'notedit-master'