Refactor core library package and class structure.