Untangle public API.

For build we only need repo url and commit ref. Rest belongs somewhere
else. On the other hand reusing as much as possible from Core.