First working version without any dependency on docker source.

This version has extensive changes and should be checked thoroughly
against any branches.

@ratzikis @nordseick @tcolar