Enable fast finishing

Close #336.
Only set repository.last_build for last build on default branch

Close #318.
Use last created build to determine status image