Feature/refactor common run markov chain

#### Summary:

This pull request moves some of the functionality of the code in RStan into Stan's common namespace so that code across interfaces can be shared more easily.

Note: this is not the final refactoring. This step allows sharing of the warmup<> and sample<> functions.  

#### Intended Effect:

RStan and CmdStan now share more common code. This pull request allows code to be shared at the level where the warmup<> and sample<> functions can be called from both CmdStan and RStan. The behavior and interface to the user has not been changed.

#### How to Verify:

There are new classes in src/stan/common/recorder with additional tests in src/test/unit/common/recorder that will demonstrate how these recorders work.

The rest of the unit, integration, and model tests should function as they always have.

#### Side Effects:

The code in Stan's common was changed to accommodate the flexibility required by RStan.
RStan's stan_fit.hpp will be able to use more of Stan's common code, as well as removal of duplicated functions and classes.

#### Documentation:

This is a true refactoring of Stan, CmdStan, and RStan. There should be nothing noticeable by users.

#### Reviewer Suggestions:

@maverickg, @bob-carpenter, or @betanalpha.