Restructure class layout, add api classes, create common directory.