Layout tweaks. Refactored JS that handles filtering