Refactor project to build framework and library