changed internal storage of a_* matrices to flattened image form
(#524)
some general tidying
(#524)
make symmetric
(#524)