Clean up of tutorial (better variable names, light additional editing); switched install doc to show github installation
Added substitute function and test
small fixes to substitute() and tests