Initial support for cloning
Added branch/reference stuff