Move some responsibility into state.go
Add .gitignore