Regarding the switching between text and visual tab, this is the behavior of WordPress. WP checks the user's favorite editing mode and saves that in the user meta. Next time the user comes back, he will see the previous mode enabled. In your case, I guess when you edit the post content in visual mode, WP saves this mode.
Besides, if you need to enter raw HTML, you can just use textarea
field. That avoids the switching issue like the editor.