Split src/common into src/lib

This work has already begun; we should have a ticket for it.