Promote Box to a class and check parameters

A valid box must have equal dimensions in position and size. It also may not have a negative size.

Fixes issue #23.