Added Variables and some Fixes

This adds support for the "variable" tag and some bug fixes.