Added common.{h,cpp} for utility purposes, no major changes.