Add Flex option extraction code.

Also adds vendorized Flex source code.