Joint estimation and testing for functional form and heteroskedasticity