Container extensions

Refactoring the containers Api to introduce definition classes
Move to separate file