fix RefreshFromServerCommand is_visible, add util.is_mm_dir()

Fix refresh visibility checking, add is_mm_dir function to check for
project base, src directory or src subdirectory. Clean up functions.