shortcode: Add attribute parsing and some tests.