Moved common.c into library common
Merge branch 'refactor'