to_sparsedict now handles numpy matrices

last fixes for #95