Refactored extension list command. Added basic test.