added rpc calculator to tutorials. Most tests passing in refactored rpc middleware