a+b.rs, added tests

moved code out of main and added tests. ref. https://github.com/Hoverbear/rust-rosetta/issues/110