Refactoring extension known / install codes. and NOW also support bitbucket.

Signed-off-by: Rack Lin <racklin@gmail.com>