Bootstrap 3 support

Refactored for Bootstrap 3. Also refactored the code a bit since there were some errors when I tried to use it.