adds partial support for variable declaration

Inserts var keyword where neeeded. This commit doesn't include
any support for checking if variable is already decalred.