A shakedown matrix theory allowing for workhardening and second-order geometric effects