Adds card-specified logging.
Adds debugging messages.
Fixes some off-by-one bugs in mill.
Adds tests for library functions.
Moves bounds checking inside Mill method.