Extract util for parsing common bits.

In preparation for new thumbnail and placeholder tag syntaxes (#177 and
#176) which share some (but not all) syntax with the generateimage tag.
Extract utils for use in other modules
New thumbnail tag syntax! Closes #177
Add thumbnail tag tests
Remove extra space
Remove _generateimage utility.