Chemistry of La on the Si(001) surface from first principles