Speed up import with cffi 0.6.
Since 0.6 cffi will try to pass the library name directly to dlopen without searching. So pass the exact names first. Saves 15 ms here.
Due to the enum format change from str to int in cffi-0.6, strings can't be passed as enum arguments.
This changes the constant generator to generate int constants and uses them everywhere instead of strings.