Major changes to the core library to handle legacy php version and to remove some module dependency.