Refactoring libcontainer to avoid cyclic dependencies in the future.

This change will make future work inside libcontainer easier since the API is separated from the internal implementation.
So we'll have to chose between duplication to de-couple the API. or keep from repeating yourself and use the same type.