Got SEF URLs working correctly with component. Added some better checks
for failing DB connections. Updated JS to work with SEF URLs as well.