Refactor tests

Includes a stub for more advanced tests.
CLIs to use the latest struct fields
Include for exit function
Avoid math if chunk isn't loaded
Clarify code