Added monopoly example

Added cmake infrastructure for building examples/*.cpp (for 'make
examples').

Added an example script that sets up an optimizing monopolist with a
bunch of optimizing agents, and gets the correct monopoly outcome.
Agent.assets() now a Bundle; added FirmNoProd

Having assets() and assetsB() feels gross, so got rid of assetsB() and
made various things just Bundles instead of BundleNegatives.  If
subclasses want negative values, they can implement it themselves in
some other way: Agent assets() will now always be just a Bundle.

eris/Firm.hpp now includes FirmNoProd, a Firm subclass that has an
exception-throwing produce() method, plus an abstract method
produceNext() intended to be used for inter-period production.
InterOpt::postAdvance() added

Interperior optimization needs two possible application points: before
agents advance() (so that agents can use the optimization results in
their advance method), and after (so that we can do things like adding
to assets after advance() clears out or depreciated assets).  Thus a new
postAdvance() method that gets called for all InterOptimizers *after*
agents advance.

eris::interopt::FixedIncome in particular needs this as the previous
change in Simulation that moved advance() to happen after apply() broke
the monopoly example: income was added in apply(), but then assets were
promptly wiped out by the call to advance().  Fixed that problem by
changing FixedIncome to use postAdvance() instead.
Renamed monopoly example to price-monopoly

Will also have a quantity-monopoly example
->apply() doesn't work on FixedIncome anymore

It got renamed to postAdvance(), but I think it's clearer to just make
the first period payment explicit.
Added quantity market test script

(doesn't work yet)
Quantity markets working!

A bunch of changes here aimed at making quantity markets work, which
they do!  (At least, the test in examples/quantity-market.cpp does).

Detailed changes:

- Got rid of interopt::JumpStepper; Stepper now includes the jump
  methods, with empty stub implementations.  Classes that want to jump
  can just override the stubs.
- Renamed interopt::Stepper to interopt::InterStepper.  Having two
  classes named Stepper (especially when one uses the other one!) was
  confusing.
- Renamed market::Quantity to market::QMarket, making it more obvious
  what it is.
- Added interopt::ProfitStepper, which looks at firm profits in the
  previous period to decide whether to move the controlled value.  It
  doesn't provide a take_step(): that comes from the implementing class.
  Both QFStepper and PriceStepper now use this for stepping logic
  (though the control different variables).
- QFStepper now looks at the effects of profits last period of last
  period's change, instead of judging whether it sold out.
- QFStepper::jump() now jumps to the previous sale value, instead of
  halving the current capacity.  Halving doesn't make much sense: if
  capacity is 100, and we sold 2, setting next period's capacity to 50
  was dumb.
- MUPD: has new optimizations to end its inner loop once we hit
  numerical imprecision (i.e. when the spending increment is too small
  to affect the values it's being added to).
- QMPricer now increases price if what whatever change happened last
  period resulted in no reduction in extra excess capacity, even if last
  period was a price decrease.  This ought to help with hitting a
  demand satiation point, while previous QMPricer would send price
  hurtling towards 0 to try to sell more.  Essentially, the new
  behaviour is such that if we find a perfectly vertical part of demand,
  we extrapolate (for one guess) that it is vertical all the way to a
  price of 0, and so the market should increase, not decrease, price.
Renamed QMPricer to WalrasianPricer

Essentially what the price is doing is serving as a Walrasian
auctioneer, so the name seems more appropriate (and imaginative) than
Q[uantity]M[arket]Pricer.
Created new threaded branch

Threaded code is currently working as long as there is only one
optimizer (i.e. no actual threads): various locking code is still needed
before eris threads actually works, hence the branch.
Changed design to use a thread pool

Threads "work" but the current code still has many thread safety
problems.  Also still tons of debugging here.
Updated for new threading interface
Eris interface overhaul

If eris had any releases yet, this would be a major version increment
release.

Optimization redesign
=====================
- Overhauled the way optimization works.  Now *any* member class can be
  an optimizer, and only implements the specific optimization methods
  that it wants, by inheriting from the appropriate interfaces in the
  new eris/Optimize.hpp header.
- This means an Agent can have interopt code, intraopt code, or no
  optimization code in its class at all.
- optimization methods are now prefixed with "inter" or "intra" since
  they are no longer contained with special optimization classes.  This
  also avoids a potential conflict between classes that want both intra
  and inter optimize() and/or apply() methods.
- Goods and Markets can now have optimization code, too, by simplying
  inheriting from the appropriate interopt::* or intraopt::* interface
  class(es).
- Got rid of InterOptimizer and IntraOptimizer base classes.
- Eris now has optimizer lists for each type of optimization stage,
  determined when a Member (of any type) is added or removed; this
  speeds things up quite a bit, because we don't have to bother checking
  every InterOpt/IntraOpt/Agent member to call its RunStage method(s),
  especially since most of them are empty.
- This also fixes the weird design of having Agent->advance(), but all
  the other interopt methods under InterOptimizer.
- All interOpt and intraOpt-related methods are now gone.  A new set of
  "other" methods was added, so that non-agent/good/market objects, such
  as objects that only do optimization, can be added to the simulation.
- Member is no longer abstract; while it was before a base class for the
  5 core types (Agent, Good, Market, InterOptimizer, IntraOptimizer),
  it's now a base for the first three, plus anything else; in
  particular, classes that are pure optimizers will now typically
  inherit from Member plus the optimization interfaces they need.
- new insertOptimizers()/removeOptimizers() methods are called when
  adding or removing any sort of member; it figures out whether the
  member is castable to the various interopt::* and intraopt::* classes,
  and if so, records the member as an optimizer of the appropriate
  class.

Threads changes
===============
- Got rid of supporting different threading models; everything now works
  as the old Sequential model.  Preallocating had a very minimal
  performance benefit, at best, since the locking was replaced with an
  atomic queue index which works much faster.  The minimal performance
  increase (on the order of a couple percent in the voting simulation)
  isn't worth the code complication (needing to worry about per-thread
  queues, in particular).

Interface changes
=================
- createAgent<A>(), createGood<G>(), etc. classes are gone now, replaced
  with a single create<T>() method.  This is a drop-in replacement for
  all of the above as it determines what the member category is by
  looking at T.
- Likewise for clone*()
- Likewise for remove*()
- agentFilter, goodFilter, etc. are renamed to the much better choice
  agents(), goods(), etc., and now return a vector instead of the
  unordered_map.  This is nice: agents() is now a vector of all agents
  (agentFilter() already was that, but it wasn't obvious from the name),
  agents<Foo> is only Foo (and Foo-derived) agents, etc.
- Member.writeLock() and .readLock() now take a variable number of
  SharedMember<T> arguments.  For example: foo->writeLock(other1,
  other2).  Previously you'd have to build a vector or list (or some
  other iterable object), add other1 and other2 to it, then call
  read/writeLock().
- The versions of Member.writeLock() and .readLock() that took an
  iterable object of pairs (e.g. unordered_map) are now gone, since
  agents/goods/etc. now return vectors instead of the unordered_maps
  agentFilter/goodFilter/etc. used to return.

Member changes
==============
- WalrasianPricer is gone: its code is now in QMarket, which declares
  itself as the appropriate intraopt::* providers.  WalrasianPricer was
  so tightly tied to QMarket that it wasn't useful as an independent
  class anyway.
- Agent is now a simpler class, *without* an assets Bundle.  The
  assets() Bundle is now provided by the eris::agent::AssetsAgent
  subclass instead.  This makes sense since the assets bundle was
  pointless for PositionalAgents, for example, which don't care about
  the assets clearing (and don't need the interopt::Advance optimizer
  just to clear assets).

Other small changes
===================
- SharedMember now has a < operator, so that SharedMembers can be added
  to ordered containers like std::set.
- Discovered (and used) std::type_index for filter_cache_ keys instead
  of calling .hash_code() on the type_info object.
- Simplified various bits of highly repetitive code with macros
- Got rid of the unique_ptr<> hack from Simulation around agents_,
  goods_, etc.  It was needed because SharedMember<Agent> wasn't
  directly constructible, but that hasn't been true for a while.
- Slightly optimized the thread signalling code to only signal the
  master from the last thread to finish the stage.
- Moved RunStage from Simulation::RunStage to just RunStage in types.h
ex/q-m: increase iterations to 300
Removed debugging; increased no. periods to 100
Removed debugging; caught sim->run() exceptions
Moving eris.git/examples/*.cpp to examples.git
Moving eris.git/examples to examples.git