reorganized the source to build some components into shared libraries