Fixed incorrect replacement of constants in template definition.

Fixed handling of constant lists.

Fixed test case.

Updated readme to include const support.