initial transaction model

Some tidying up too