Init and setpin

I have not properly tested this code. But decided to go ahead and push it just in case it is needed by anyone. Go ahead and review if you like. But it needs to be properly tested before merging into v3. I  was using pkcsconf to test and can finish when i get back.