Separation of thread activity types, using switches and includes. added fb libraries