Fix array.sort.

array.sort was broken since 2001 when the implementation was changed
from merge sort to SAM sort.

library/array.m:
	Fix the confusion as to which output argument of samsort_up is
	sorted.

	Add optional runtime checks of the pre- and post-conditions
	of samsort_up and samsort_down when built with a trace flag.

	Add array.sort_fix_2014.

tests/hard_coded/Mmakefile:
tests/hard_coded/array_sort.exp:
tests/hard_coded/array_sort.m:
	Add test program.

NEWS:
	Announce the fix.
Avoid module qualification in the interface of the io module where possible.

library/io.m:
	Avoid module qualification in the interface where possible.
	I've left the module qualifiers on the types io.state/0 and io.error/0
	since they just look strange without them.  (We don't really use io.state/0
	much these days anyway.)

	Most the result types (e.g. io.res/0) still require module
	qualification in order to distinguish them from the result types
	in the stream module.

	s/input_stream/text_input_stream/ for the all uses of the type
	input_stream.  Similarly for output streams.  This was what was
	intended when the equivalences were originally introduced and the
	debugger has used the text_* names for many years now.

library/store.m:
	s/io\.state/io/ in a few spots.
Merge branch 'version-14_01-branch'
Restore promise_pure declaration for catch_impl.

I inadvertently deleted a promise_pure declaration for catch_impl in
commit 3f220a009735b1bda71e1ce320025e66811fb4b5.  It is necessary in
java and csharp grades as catch_impl is implemented with mode-specific
clauses in those grades so the compiler infers impure.

library/exception.m:
	Restore the promise_pure declaration.

	Add Zoltan's explanation for why catch_impl is impure.

	Explain why we currently pretend catch_impl is pure.