Move code to lib.rs and adjust crate_name

According to crates.io this is best practice. Also no
warnings/errors on this one with rust/cargo nightly
Merge pull request #2 from badboy/nightly-fixes-1

Move code to lib.rs and adjust crate_name