Fix a test bug, changed execution exception to compilation exception in
most cases, and added docs for expression scripts.