Added foundation.css

Optimized js to make code more reusable