first-pass refactor of card.js; moved templates into their own partial
some comments about genericizing API integrations with factories