Okay, first step is to get some tooling in place to make it easier to
deal with developing this thing. Since I'm expecting to work on this
for a while, and will probably end releasing the code on CPAN,
it makes sense to invest a little up front effort on making testing
and releasing the code easier.

Item the first: a Dist::Zilla config. If you're not familiar
with Dist::Zilla, it's a set of tools to make it easier to write Perl
code with an eye towards distributing it on CPAN. There's more info at
the Dist::Zilla site.

Since I've been using dzil for a while, I've taken the step of
uploading my own plugin bundle to CPAN -- so my
dist.ini file to configure Dist::Zilla is pretty
straightforward:

The intro boilerplate is pretty self-explanatory, and all that last
line says is "use my standard plugins and settings."

Item the second: Test::Class tooling. I've been using the
OO-ish approach to writing tests for a while now and I find it very
convenient. I'm not going to try to explain how it works, since Ovid
has already written a very nice series of articles over on
Modern Perl Books about using this module:

To make it easier to use we're just going to create a test helper to
run all our Test::Class tests -- this will go in a file called
t/01-run.t:

#! perl
use strict;
use warnings;
use Test::Class::Load qw( t/lib );

All that does is automatically find all our testing libraries under
t/lib and automatically run each one in turn. We're also
going to create a testing base class at
t/lib/Test/BASE.pm that all our test libraries will
inherit from:

This is done so that individual test libraries will do the right thing
when run with the prove tool -- more about that in a
later installment.

Item the third: a top level library file. This isn't strictly needed,
and isn't going to contain any code, but I always like to have a
module file that matches the name of the distribution. So we'll put
this into lib/Jacquard.pm: