reformat and reorganize decls
add RMA to build
add a vector version of newtype constructor to amortize overead