move some register functions to c extension.

Not sure how the load path works, so I just used the 'require_relative' with tons of '..'s
ignore linux shared libraries
use native C types