implement chmod method

First cut at #82 

Needs testing on Windows among other things, given partial portability of chmod