implement chmod method

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