Separate libclsync stuff from common.h

Also use sys/param.h for MIN, MAX macros.