Standard outputSuccess and outputFailure created

Soon, as many public functions as possible will be converted into using
these, with the equivalent front-end JS scripts updated to check for
'status' = 'success'/'failure'.