GCC Plugin: Replace config arguments with mageec_config map.

This avoids a case where the globals storing MAGEEC state were
being clobbered by some GCC passes.

        * gcc_plugin/gcc-callbacks.cpp (mageec_pass_gate): Use mageec_config
        map for configuration instead of larger set of globals.
        * gcc_plugin/gcc-plugin.cpp (parse_arguments): Likewise.
        * gcc_plugin/mageec-plugin.h (mageec_print_pass_info): Removed,
        replaced with mageec_config.
        (mageec_no_decision): Removed, replaced with mageec_config.
        (mageec_config): Added.
Update feature extractor to be GCC 4.9 compliant.

        * gcc_plugin/feature-extract.cpp: Added conditional includes for GCC
        4.9 and above.
        (mageec_featextract_exec): Replace FOR_EACH_BB with FOR_ALL_BB_FN for
        GCC 4.9 and above.
        (pass_data_mageec_featextract): Added for GCC 4.9 and above.
        (class mageec_featpass): Likewise.
        (make_mageec_pass): Likewise.
        (register_featextract): Update pass reference depending on GCC 4.9.
Make GCC plugin configure tests build with C++ compiler.

        * configure.ac: Make test for GCC headers using a C++ compiler instead
        of C.
        * configure: Regenerated.
Add Database training tool to enable command line training.

        * include/mageec/mageec-ml.h (mageec_ml::init): Add path to database
        virtual init function.
        (class file_ml): Likewise.
        * mageec/Makefile.am: Add rules for building mageecdb
        * mageec/Makefile.in: Regenerated.
        * mageec/dbtool.cpp: Add initial database management tool.
        * ml/ml.cpp (mageec_ml::init): Add path to database function. Modified
        COMPILER, VERSION init function to use this instead.
        (file_ml::init): Likewise.
Fix GCC version checking and remove unneeded include from feat extract.

        * gcc_plugin/feature-extract.cpp: Use bversion.h to determine version.
        Removed plugin-version.h from includes.
        * gcc_plugin/Makefile.am: Build with -fno-rtti.
        * gcc_plugin/Makefile.in: Regenerated.
Fix bugs in database schema and retrieve only low energy results.

        * ml/database.cpp (qinit3): Make prog field in features TEXT.
        (qinit4): Remove invalid foreign key constraint.
        (get_all_results): Only select results with the lowest energy.
        Correct mprintf for feature set selection to use %Q instead of %s.