refactor card to directive
add extension support
make card template customizable