First draft at auto-op/deop feature. Incomplete.