Review/Refactor/DRY up types after switching to REST API
Description
This is a follow-up issue to Avoid CORS issues by using /projects/:id/reposi... (!24 - merged)
That MR introduced several areas of duplication around the IFile type and representation of stats.
We should review and refactor as appropriate.