rename lib to libcommon and move include files
Add class for main loop