Added Creativity main class

Moved much of the logic and parameter settings from gui.cpp into
Creativity so that a (future) cli.cpp can use the same logic.

This also gets rid of the global variables in common.{cpp,hpp}: they
have been replaced with members of the Creativity object, which gets
passed around now.

This commit also enforces locking on both state and new_books access:
the former was already there (but required external cooperation); the
latter wasn't present at all (and may well have been a cause of the
occassional segfaults when running multi-threaded as new books would
enlarge NEW_BOOKS, which might invalidate the old storage that another
thread was accessing.

Creativity::newBooks() and ::storage() now return a pair: .first is the
requested element (vector& for the former, shared_ptr& for the latter),
and .second (which never needs to be touched) is the active lock.