optimisations for sparse matrix copying
more optimisations and refactoring
optimise generic sparse() operation
refactor to tidy special cases
code tidying