Added informative error message and error handling

Added informative error message when filename is passed as stan code, and error handling and an error message when an invalid index is passed to chains.ess

This revised pull request explicitly checks the value of the index n passed to chains.ess, raising a RuntimeError if it is out of the valid parameter range.