Fixing search issue, #421

Search was returning 404 with results, php notice and other inconsistencies, slimming code base down and moving into pre get posts, and a search class.

Signed-off-by: Zane M. Kolnik <zanematthew@gmail.com>