Fixes for tmux auto attach

This commit moves some code between `.bashrc` and `.bash_profile` to
facilitate tmux auto attach in a more reliable manner (i.e. don't
attempt it in non-login shells). Also includes some extra tmux config to
enable mouse support.
Vim: remove indentation inside C++ namespaces