Improve function for getting the chroot and proot arguments
Make some functions in core private