expand build_ffi helper function

Switched invocations of it to using kwargs to be less confusing, added support for extra_compile_args and extra_link_args (which will be needed when we start linking against OS X frameworks soon).