Adds JUnit tests

Not all tests are passed yet; a change to how discounts are applied is needed. (Currently they're applied multiple times in ceratin cases)