Fix propagating return value
Add tests for AJAX parts of translate page