Lagrangians for chiral bosons and the heterotic string