Added several scopes after testing with Railo (Implicit variable Access), moved var to function top

added several missing variables and arguments scopes