Tests refactored to use rspec 3 + lot of fixes

@bf4, can you take a look to this ?