Fix encoding of macros.

No macros should be escaped because of which macros is resolved, but for where
the macros is put.

URL-encoding macros should be done when building an URL, not if the URL is
included in the macro. Therefore, encoding options should only be brought
downwards, and only one level in the encoding.

An example:

notes: this is a string escaped with & and other chars for $HOSTADDRESS$
notes_url: http://wiki.example.org/?notes=$HOSTNOTES$&address=$HOSTADDRESS$
action_url: http://example.org/?notes_url=$HOSTNOTESURL$&notes=$HOSTNOTES$

The result should be something like:

notes:
address should be included, but not escaped. It should be readable by a person

notes_url:
both notes and address should be url-encoded, because they are a part of the
url, but shouldn't change the structure of the url (like including new
variables)

action_url:
should urlencode notes_url, which means parts is double-encoded, because the
notes_url-attribute should, when unpacked by the web server, contain the
notes_url, and the notes should be encoded, so the same applies to notes

Signed-off-by: Max Sikström <msikstrom@op5.com>