bashrc: reordered some functions and variable declarations to be a little cleaner