Script: use popBool, popStack instead of tStackN

datatype-specific push and pop functions read better than tStackN functions and
allow checking for error conditions properly.

Fixes last failing test from `script_invalid.json`

Fixes #6, #4