Build ropchain into shared library

Build ropchain into shared library and some other fixes