don't use given/when

given/when is now considered experimental and thus warns as of 5.18.
Since we use Test::NoWarnings, this means that the tests fail on all
new systems. Remove the use of given/when, replacing it with normal
if/then.
Move dataset reading into separate module

Create Project.pm to represent a project directory and the contained
data files. Move all data-reading functionality into Project.pm,
refactoring where the opportunity arises. Don't use it like a normal
library yet; instead, just load all of the keys of the project object
into the AM object. More refactoring to come, obviously.
Provide accessors for project path

Provide accessors for project base path and project report file (which
is currently always 'amcpresults', but could be customized in
the future.) Use these accessors in AM.pm.
Check data vector sizes while loading data

Create a separate method for adding data as it is read from the project
data file. Check that all of the data vectors in the file have the same
length, and croak if they don't.
Refactoring and cleanup of Project.pm

Commenting and refactoring when opportunity arises, move misplaced code
to its correct place in Project.pm or into AM.pm. Sum initialization
has nothing to do with the project files, so move it into AM.pm. The
_compute_vars method seems mostly concerned with how to divide the
variables among the four lattices, so move the code setting the data
vector length and the variable format out of it.
pre-parse test file

Instead of waiting until classification time to parse the test file
(which would surely duplicate work), parse the test file in Project.pm.
Check each test item for the correct size. Store the outcome, data, and
spec separately, with data being another arrayref containing individual
variable values.

parse test file before prediction time, and check the size of every data vector
create _compute_lattice_boundaries method

The _compute_vars method is entirely concerned with computing which
variables go in which lattices. Therefore, rename it to reflect its
function, and factor out a block of code in AM.pm that does the same
thing. Refactor and comment to make the function and use more clear.

moved _compute_lattice_boundaries, which has nothing directly to do with reading project data, back into AM.pm

Factored out calculation of lattice sizes. Also added lots of comments where needed
use accessor methods to provide format variables

Create accessor methods in Project.pm to provide printing format
variables, and refactor AM.pm to use these accessors.
accessor for number of data items

Provide an accessor for the number of data items found in the project.
Use this method in AM.pm instead of checking the length of
$self->{data} directly.

added accessor to obtain num of exemplars in data set
Refactor outcome reading methods

Refactor the outcome reading methods to have more defined functions.
Remove the outcomecounter variable, which turned out to be extraneous.

got rid of outcomecounter object variable
get_data and short_outcome_index

Add get_data and short_outcome_index methods to Project.pm, and
refactor AM.pm to use these accessors.
accessors for {data}, {outcome} and {spec}

Provide accessors for {data} {outcome} and {spec} in Project.pm so that
AM.pm can access them through a method instead of using long
dereferencing expressions (and to further modularize Project.pm).
{outcome} accessor

Add an accessfor for $project->{outcome}, and use it in AM.pm.
Refactor and comment where opportunity arises.
{outcometonum} accessor

Add an {outcometonum} accessor in Project.pm and use it in AM.pm.
Refactor and comment where opportunity arises.
test items and hook variable accessors

Add accessors for the test items and for {specs}, {data} and
{outcomelist}, which are all supposed to be available to the hook
methods.
more modular accessors for outcomelist

Add more accessors to the information in outcomelist, but instead of
just returning the whole structure, provide 1) the size of the array
(or number of outcomes) and 2) the outcome at a given index. Refactor
AM.pm to use these wherever possible. _outcomelist cannot be removed
because the whole structure must be available to the hook methods.
test hook variables with outcome file

Create tests for the values of @outcomelist and %outcometonum within
hook methods when an outcome file is present.

@outcomelis and %outcometonum both differ when an actual outcome file
is present in the project. This is because both of these variables
relate to the "long" version of an outcome, which is only available in
a project outcome file. Without the outcome file, the "short" outcomes
are copied from the data set to replace the "long" outcomes.
save caller's autoflush setting

Instead of setting autoflush to true on STDOUT in the AM
constructor, set it in the classify method (where it is important), and
restore the caller's setting at the end of the method.