translator: throw error exceptions at top level

changed function operator to throw error instead of error in rpn list
replaced error item is empty with boolean operator function
removed error variables from rpn list
changed program model encode to take rvalue reference