Substitute System v 1

I have finally put together the substitute system. We still need to
figure out the emails to the users, but the rest is working.