exp/html: improve InHeadIM
exp/html: improve InHeadIM

Clean up the flow of control, and add a case for doctype tokens (to
ignore them).

R=nigeltao
CC=golang-dev
http://codereview.appspot.com/6069045

Committer: Nigel Tao <58ae08b3356928ff9c67562b4719487d54fe8348@golang.org>

webfd/go-zh,Triskite/willstone-goclone,sanjosh/sanjos100-tipc,bryanxu/go-zh,d0f/go-zh,scirelli/scirelli-go,scirelli/scirelli-go,mhennings/marcohennings-go,webfd/go-zh,rflanagan/reginaldflanagan-project1,webfd/go-zh,d0f/go-zh,mhennings/marcohennings-go,bryanxu/go-zh,sanjosh/sanjos100-tipc,rflanagan/reginaldflanagan-project1,mhennings/marcohennings-go,sanjosh/sanjos100-tipc,sanjosh/sanjos100-tipc,scirelli/scirelli-go,rdp/rogerpack2005-golang,glycerine/jeaten-go-arrayof-structof,webfd/go-zh,bryanxu/go-zh,Triskite/willstone-goclone,Triskite/willstone-goclone,glycerine/jeaten-go-arrayof-structof,bryanxu/go-zh,bryanxu/go-zh,scirelli/scirelli-go,Triskite/willstone-goclone,webfd/go-zh,rflanagan/reginaldflanagan-project1,webfd/go-zh,rdp/rogerpack2005-golang,rflanagan/reginaldflanagan-project1,sanjosh/sanjos100-tipc,sanjosh/sanjos100-tipc,bryanxu/go-zh,glycerine/jeaten-go-arrayof-structof,glycerine/jeaten-go-arrayof-structof,glycerine/jeaten-go-arrayof-structof,d0f/go-zh,mhennings/marcohennings-go,Triskite/willstone-goclone,glycerine/jeaten-go-arrayof-structof,scirelli/scirelli-go,scirelli/scirelli-go,rdp/rogerpack2005-golang,d0f/go-zh,d0f/go-zh,glycerine/jeaten-go-arrayof-structof,rflanagan/reginaldflanagan-project1,rdp/rogerpack2005-golang,rdp/rogerpack2005-golang,scirelli/scirelli-go,Triskite/willstone-goclone,sanjosh/sanjos100-tipc,d0f/go-zh,rflanagan/reginaldflanagan-project1,rflanagan/reginaldflanagan-project1,scirelli/scirelli-go,mhennings/marcohennings-go,d0f/go-zh,rflanagan/reginaldflanagan-project1,bryanxu/go-zh,mhennings/marcohennings-go,webfd/go-zh,rdp/rogerpack2005-golang,d0f/go-zh,sanjosh/sanjos100-tipc,bryanxu/go-zh,glycerine/jeaten-go-arrayof-structof,rdp/rogerpack2005-golang,Triskite/willstone-goclone,mhennings/marcohennings-go,webfd/go-zh,rdp/rogerpack2005-golang,Triskite/willstone-goclone,mhennings/marcohennings-go