Fixed a bug with the template conditional expressions.

If first entry was a string it would assume that all the following
entries were also strings.
It has been rewritten now so that it loops over each entry and then
determines whether it is a string, hash or array and whether
the values following is a string or array.
Updates for the template, readme and spec test

The template file was quite flawed so it has been rewritten
for hashes only. It takes hashes with values as string
or array.
Spec tests have been created for:
Hash with string value
Hash with array values
Hash with no value
Hash with string, array and no value.