Add shared library.
Some shared changes