refactor spinner logic
switch to phantomjs in karma