Use defcustom :safe key instead of setting safe

Signed-off-by: Erik Charlebois <erikcharlebois@gmail.com>
Use defvar-local and setq-locale

make-variable-buffer-local is intended only for top-level forms. Make
sure all variables are defined prior to use to avoid bytecode
compilation warnings.

Signed-off-by: Erik Charlebois <erikcharlebois@gmail.com>