transaction domain and some TDD
minor tidy for js