Fix build with latest master

Replaces `fail!` with `panic!` and fixes some lints. Travis will still fail due to issue #11.