Fixed atan2 bug. Issue #438

Math.atan2 was broken by 36ae115. The parameters were reversed. Unittest was also fixed to expose bug.