Updated FSM Sequence Classes

Moved Query FSM into its own class since it is not related to any of the
other sequences. The rest of the sequences were restructured to work
exclusively with stringstreams.