Add scalar operations test, and fix related bugs; add from_ndarray convenience function; add 'pow' arithmetic operator to scalar types