Close gocode daemon at emacs exit

Register a kill-emacs-hook to run 'gocode close' when emacs exits.

The hook is not registered if the daemon unix socket already exists,
assumes gocode daemon was running before go-mode was loaded.
Use company-grab-word instead of a regex

The regular expression being used here doesn't always give desirable
results.

Example:

```go
thing := OtherThing()
thi // won't autocomplete to `thing`

type Foo struct {
   Bar string `bson:"foo"`
}

foo := Foo{}
foo.B // will autocomplete to `Bar`
```

Because it has a hard `.` anchor in it, it will only ever match methods
or attributes and never local variables, even though `gocode` itself
would complete both cases fine. Changing it to `company-grab-word`
satisfies both cases because we get a matching prefix.
Merge branch 'fix-company-mode-prefix' of https://github.com/bradleywright/gocode
Process closures in global scope like ordinary functions. Fixes #185.
[emacs-company] Add autoload cookie
emacs-company: Support location
Fix bug that don't work with prefix typed
emacs-company: Support annotation
emacs-company: Make showing annotation optional
fixes #194
Rework cursortype behaviour to better match its name
Add a fallback check -- if pkg/OS_ARCH for the lib-path variable works, then use that.
Can't set system function name to lower letter variables. gocomplete#system_function should be set as string of function name instead of function reference.
Allow emacs to exit when gocode binary cannot be found
Add -debug mode for developers.
Extend -debug mode by including completion candidates, add docs.
Add a header to docs for server-side -debug mode section.
Add skip_to_left_bracket() function in cursorcontext.go
Initial commit for struct initialization autocompletion.

This allows autocompletion of member names when initializing a struct,
as long as the members are defined one per line.

ref #117
Convert bracket maching functions to use runes instead of bytes