Make the parse_func_t take a const string ref.

This can improve performance by quite a bit, so I'm doing it. I assume
anyone with a brain can figure out that they should make a copy of the
string if they want to keep it around. A const string ref isn't much
use except as a parameter anyway. Don't try to correct me on that.
Replace range-based loop for iterating over c_str

Again, performance. This is simply faster and accomplishes the same
thing with a couple lines more.
Move some member funcs into state_t.

Also moves func_ into state_t. This is mostly because the state and
the parser are somewhat independent (the parser just works on the
state, so I see it).

Basically, this is all in the name of mostly pointless performance. In
the end, this cuts 5 seconds off the parser when it's used to parse a
small document 2^20 times. Not really important, but it's a feel-good
thing I can do.