purchasing module done

Nearly all core functionality is now in place. Will get it up on a
server for testing now and populate with some data to see how it works
in alpha testing.