Add replace test
Fix basedir
Rewrite translator. Parse if statements.