Refactor fileman and fix memory leak

This also changes the keybindings a little