Force ordering in dict_to_numpy_array functions

Force ordering to be that of the provided mapping dictionary or else create a mapping using the input data dictionary ordering.

Fix tests to determine ordering.
Merge pull request #1006 from hagberg/master

Force ordering in dict_to_numpy_array functions