Multiple $emessage to $mes replacements and old code clean-up. Updated headers.