Added comments and debug ApeScript output

Added some comments and made sure all debug ApeScript output came
through printf rather than to a file.