Request to merge email branch

Use nested module/class definitions instead of compact style.