General Ramified Recurrence is Sound for Polynomial Time