Fix 'command^d' causing a segfault
Fix history entry format
Mod index to avoid garbage memory
Fix doc and remove unused parameter
All the helper methods :octopus: