index/categories changes

Moved session_start to prevent PHP Notice, indented code and placed
checkers. Just for starters :)