Errors and warnings are processed in IStatus independently. Completion code
is moved away from IStatus and returned directly by appropriate functions.
Replaced isSuccess() with more generic function getStatus(), which sets
appropriate bits in returned value when errors/warnings are present.
Also use same style when returning bytes' array and it's length in different
interfaces.