Moved code to function

Left / Right and spacebar navigation moved to functions
Updated help section
Fixed JavaScript error