Auction Recalculation

Massive update. Added the ability to automatically recalculate auction
results on a fixed schedule while giving each progressive round a larger
and larger discount. This is to ensure that bids that aren't paid are
skipped and the next potential user is given a chance to buy the slot at
a discount.

The work included in this commit:
Changed the states in which a bid can be in. On creation a bid has no
set state and this is considered to be a valid bid. Upon auction closing
and recalculation, the bid state can range from invalid (admin has
removed this bid), lost (this bid has not won any slots in this
auction), or can hold a property of wonSlots that counts the number of
slots this bid has currently won. There is also a void state that can
exist with the wonSlots state of a bid. In this scenario, a bid with a
void state has not paid at least one invoice, but if this bid also has a
wonSlots property, the number in wonSlots is the number of slots this
bid has already paid for. Any other slots this bid contains is no longer
counted in the auction. The valid state for a bid is no longer used and
has been replaced with the invalid state.

Updated the bidding algorithm to account for the void and wonSlots state
of a bid. If a bid is void, the number of slots for this bid is set to
zero. If a bid is void and has a wonSlots property, the number of slots
for this bid is now equals to wonSlots. Before the bidding algorithm is
invoked, the lost and invalid bids are removed beforehand.

Updated the config to set the max number of rounds a recalculation can
have, the time offset of each round (measured in milliseconds), and the
percentage discount per round.

Added a recalculation object to the DB that keeps track of the current
iteration of the recalculation process, the auction id of the auction
this recalculation is for, the expiration of the current recalculation
iteration, and a flag that represents if this recalculation is finished
or not.

Added two views to couchapp that return all recalculations in the DB and
bids for a user for a particular auction.

Added methods in the DB to create, retrieve, retrieve all, and update
recalculation objects. Also added a method to use the aforementioned
view to get all bids for a user per auction.

Fixed a bug where bid validation still looked at the slots property of
an auction instead of the slots property of each region of an auction.
This validation also ensures that the correct auction region is
consulted for its slots property.

Added a DB method to force the update of a bid's states after an auction
is closed.

Added expiration times for an invoice in the winner and winner-modified
email template so the user how long they have to pay the invoice.

Added discounts and expiration times to the auction-close and invoice
files so that an invoice has the correct discount on the lineitems per
recalculation iteration and a proper expiration time from Baron.

Added a timer related methods to the event-timer for recalculations.
This involved modifying the site.js file to create a new worker and
registered functions for recalculation, new, update, and delete methods
for the recalculation timer and a new resque file to get all in process
recalculation on server startup. This allows recalculation to survive
server faults.

Enhancement: Sorted all the bids in the auction view. They are now
sorted by time rather than id.