Update rust crates

Added vendor/getopts and updated the rest.

Change-Id: Ifb5d553a7aa964c7a46a7a6109abe5a3714f647f
diff --git a/vendor/atom/.cargo-checksum.json b/vendor/atom/.cargo-checksum.json
deleted file mode 100644
index 34d3057..0000000
--- a/vendor/atom/.cargo-checksum.json
+++ /dev/null
@@ -1 +0,0 @@
-{"files":{".load.png":"c5ef4c1f0884c760e551531ccf8b40e91116019faf9bfadf046ea8b119e79f65",".store.png":"638ad516ceeb7e565cfd24207ff5b701b331924773cd2cbb03064179630836e4",".swap.png":"cb6d762b36c2e521c0ee6ea028fcfe89da1fe1840c201c22cc952688898af737",".travis.yml":"5603284ca84547c407933f8e1589b2bd97cf67f8ebed2492c1ce8a7cd946dbf4","Cargo.toml":"62f140a4a367994242e7f1f6849345f8bc9422f70a6388019779730fef6ab79b","LICENSE":"09e8a9bcec8067104652c168685ab0931e7868f9c8284b66f5ae6edae5f1130b","examples/fifo.rs":"b5b5bf9720058772750bbf9725e38830f9da398c7eff0deb01dcbd974f260562","examples/simple.rs":"848f26793ab1afc647cf256c7af73ac2822deebf1fda500785aff69daff5e127","readme.md":"a91b178c0b0fab0af36854d760e354808c36bbeda1bf11e77a8e02a5e4ad1a9d","src/lib.rs":"163c30858ddc683f796af1abb86abaf40134dbbdd3f552f94db117fdb063b986","tests/atom.rs":"3957a76508bf4b82404a69d766d7dd8b05b6a5247e0854eec36767d36d28cbd7"},"package":"4cd7b80cba09d9c6679f5ac66af2e5eb9c17fa1b914f142d690b069ba51eacaf"}
\ No newline at end of file
diff --git a/vendor/atom/.load.png b/vendor/atom/.load.png
deleted file mode 100644
index 3327e64..0000000
--- a/vendor/atom/.load.png
+++ /dev/null
Binary files differ
diff --git a/vendor/atom/.store.png b/vendor/atom/.store.png
deleted file mode 100644
index b103d08..0000000
--- a/vendor/atom/.store.png
+++ /dev/null
Binary files differ
diff --git a/vendor/atom/.swap.png b/vendor/atom/.swap.png
deleted file mode 100644
index 82e724f..0000000
--- a/vendor/atom/.swap.png
+++ /dev/null
Binary files differ
diff --git a/vendor/atom/.travis.yml b/vendor/atom/.travis.yml
deleted file mode 100644
index 6d04304..0000000
--- a/vendor/atom/.travis.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-language: rust
-
-env:
-  global:
-    - secure: l8hKyZzEGNBE/j44xOFJS04MRM1icLvBMT5QK6sujJ+wN9X/jE4pBDLuL3ByajnQyspJOgqvNvYkMchQGKW7Aqan+VorKGk/CFf7+ly3Dpeitq/tNTZdu454kKGvMWfU7a2ETVHg19uN5Lo9p40tWiTTYJ+0lt8tK+AEkAriLbs=
-
-script:
-  - cargo build
-  - cargo test
-  - cargo doc
-
-after_script:
-  - mv target/doc doc
-  - curl http://www.rust-ci.org/artifacts/put?t=$RUSTCI_TOKEN | sh
-
-
-
diff --git a/vendor/atom/Cargo.toml b/vendor/atom/Cargo.toml
deleted file mode 100644
index c7f2eab..0000000
--- a/vendor/atom/Cargo.toml
+++ /dev/null
@@ -1,7 +0,0 @@
-[package]
-name = "atom"
-version = "0.3.4"
-authors = ["Colin Sherratt <colin.sherratt@gmail.com>"]
-license = "Apache-2.0"
-homepage = "https://github.com/slide-rs/atom"
-description = "A safe abstraction around AtomicPtr"
diff --git a/vendor/atom/LICENSE b/vendor/atom/LICENSE
deleted file mode 100644
index 67db858..0000000
--- a/vendor/atom/LICENSE
+++ /dev/null
@@ -1,175 +0,0 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
diff --git a/vendor/atom/examples/fifo.rs b/vendor/atom/examples/fifo.rs
deleted file mode 100644
index 51039d9..0000000
--- a/vendor/atom/examples/fifo.rs
+++ /dev/null
@@ -1,79 +0,0 @@
-//   Copyright 2015 Colin Sherratt
-//
-//   Licensed under the Apache License, Version 2.0 (the "License");
-//   you may not use this file except in compliance with the License.
-//   You may obtain a copy of the License at
-//
-//       http://www.apache.org/licenses/LICENSE-2.0
-//
-//   Unless required by applicable law or agreed to in writing, software
-//   distributed under the License is distributed on an "AS IS" BASIS,
-//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//   See the License for the specific language governing permissions and
-//   limitations under the License.
-
-extern crate atom;
-
-use std::thread;
-use std::mem;
-use std::sync::{Arc, Barrier};
-use atom::*;
-
-const THREADS: usize = 100;
-
-#[derive(Debug)]
-struct Link {
-    next: AtomSetOnce<Box<Link>>
-}
-
-impl Drop for Link {
-    fn drop(&mut self) {
-        // This is done to avoid a recusive drop of the List
-        while let Some(mut h) = self.next.atom().take() {
-           self.next = mem::replace(&mut h.next, AtomSetOnce::empty());
-        }
-    }
-}
-
-fn main() {
-    let b = Arc::new(Barrier::new(THREADS + 1));
-
-    let head = Arc::new(Link{next: AtomSetOnce::empty()});
-
-    for _ in (0..THREADS) {
-        let b = b.clone();
-        let head = head.clone();
-        thread::spawn(move || {
-            let mut hptr = &*head;
-
-            for _ in (0..10_000) {
-                let mut my_awesome_node = Box::new(Link {
-                    next: AtomSetOnce::empty()
-                });
-
-
-                loop {
-                    while let Some(h) = hptr.next.get() {
-                        hptr = h;
-                    }
-
-                    my_awesome_node = match hptr.next.set_if_none(my_awesome_node) {
-                        Some(v) => v,
-                        None => break
-                    };
-                }
-            }
-            b.wait();
-        });
-    }
-
-    b.wait();
-
-    let mut hptr = &*head;
-    let mut count = 0;
-    while let Some(h) = hptr.next.get() {
-        hptr = h;
-        count += 1;
-    }
-    println!("Using {} threads we wrote {} links at the same time!", THREADS, count);
-}
\ No newline at end of file
diff --git a/vendor/atom/examples/simple.rs b/vendor/atom/examples/simple.rs
deleted file mode 100644
index 3e83878..0000000
--- a/vendor/atom/examples/simple.rs
+++ /dev/null
@@ -1,29 +0,0 @@
-extern crate atom;
-
-use std::sync::Arc;
-use std::thread;
-use atom::*;
-
-fn main() {
-    // Create an empty atom
-    let shared_atom = Arc::new(Atom::empty());
-
-    // set the value 75 
-    shared_atom.swap(Box::new(75));
-
-    // Spawn a bunch of thread that will try and take the value
-    let threads: Vec<thread::JoinHandle<()>> = (0..8).map(|_| {
-        let shared_atom = shared_atom.clone();
-        thread::spawn(move || {
-            // Take the contents of the atom, only one will win the race
-            if let Some(v) = shared_atom.take() {
-                println!("I got it: {:?} :D", v);
-            } else {
-                println!("I did not get it :(");
-            }
-        })
-    }).collect();
-
-    // join the threads
-    for t in threads { t.join().unwrap(); }
-}
\ No newline at end of file
diff --git a/vendor/atom/readme.md b/vendor/atom/readme.md
deleted file mode 100644
index a655bf4..0000000
--- a/vendor/atom/readme.md
+++ /dev/null
@@ -1,101 +0,0 @@
-Atom
-====
-
-[![Build Status](https://travis-ci.org/slide-rs/atom.svg?branch=master)](https://travis-ci.org/csherratt/atom)
-[![Atom](http://meritbadge.herokuapp.com/atom)](https://crates.io/crates/atom)
-
-`Atom` is a simple abstraction around Rust's `AtomicPtr`. It provides a simple, wait-free way to exchange
-data between threads safely. `Atom` is built around the principle that an atomic swap can be used to
-safely emulate Rust's ownership.
-
-![store](https://raw.githubusercontent.com/csherratt/atom/master/.store.png)
-
-Using [`store`](https://doc.rust-lang.org/std/sync/atomic/struct.AtomicPtr.html#method.store) to set a shared
-atomic pointer is unsafe in rust (or any language) because the contents of the pointer can be overwritten at any
-point in time causing the contents of the pointer to be lost. This can cause your system to leak memory, and
-if you are expecting that memory to do something useful (like wake a sleeping thread), you are in trouble.
-
-![load](https://raw.githubusercontent.com/csherratt/atom/master/.load.png)
-
-Similarly, [`load`](https://doc.rust-lang.org/std/sync/atomic/struct.AtomicPtr.html#method.store) 
-is unsafe since there is no guarantee that that pointer will live for even a cycle after you have read it. Another
-thread may modify the pointer, or free it. For `load` to be safe you need to have some outside contract to preserve
-the correct ownership semantics.
-
-![swap](https://raw.githubusercontent.com/csherratt/atom/master/.swap.png)
-
-A [`swap`](https://doc.rust-lang.org/std/sync/atomic/struct.AtomicPtr.html#method.swap) is special as it allows
-a reference to be exchanged without the risk of that pointer being freed, or stomped on. When a thread
-swaps an `AtomicPtr` the old pointer ownership is moved to the caller, and the `AtomicPtr` takes ownership of the new
-pointer.
-
-
-Using `Atom`
-------------
-
-Add atom your `Cargo.toml`
-```
-[dependencies]
-atom="*"
-```
-
-A short example:
-```rust
-extern crate atom;
-
-use std::sync::Arc;
-use std::thread;
-use atom::*;
-
-fn main() {
-    // Create an empty atom
-    let shared_atom = Arc::new(Atom::empty());
-
-    // set the value 75 
-    shared_atom.swap(Box::new(75));
-
-    // Spawn a bunch of thread that will try and take the value
-    let threads: Vec<thread::JoinHandle<()>> = (0..8).map(|_| {
-        let shared_atom = shared_atom.clone();
-        thread::spawn(move || {
-            // Take the contents of the atom, only one will win the race
-            if let Some(v) = shared_atom.take() {
-                println!("I got it: {:?} :D", v);
-            } else {
-                println!("I did not get it :(");
-            }
-        })
-    }).collect();
-
-    // join the threads
-    for t in threads { t.join().unwrap(); }
-
-```
-
-The result will look something like this:
-```
-I did not get it :(
-I got it: 75 :D
-I did not get it :(
-I did not get it :(
-I did not get it :(
-I did not get it :(
-I did not get it :(
-I did not get it :(
-```
-
-Using an `Atom` has some advantages over using a raw `AtomicPtr`. First, you don't need any
-unsafe code in order to convert the `Box<T>` to and from a `Box` the library handles that for
-you. Secondly, `Atom` implements `drop` so you won't accidentally leak a pointer when dropping
-your data structure.
-
-AtomSetOnce
------------
-
-This is an additional bit of abstraction around an Atom. Recall that I said `load` was unsafe
-unless you have an additional restrictions. `AtomSetOnce` as the name indicates may only be
-set once, and then it may never be unset. We know that if the `Atom` is set the pointer will be
-valid for the lifetime of the `Atom`. This means we can implement `Deref` in a safe way.
-
-Take a look at the `fifo` example to see how this can be used to write a lock-free linked list.
-
diff --git a/vendor/atom/src/lib.rs b/vendor/atom/src/lib.rs
deleted file mode 100644
index d7705b7..0000000
--- a/vendor/atom/src/lib.rs
+++ /dev/null
@@ -1,300 +0,0 @@
-//   Copyright 2015 Colin Sherratt
-//
-//   Licensed under the Apache License, Version 2.0 (the "License");
-//   you may not use this file except in compliance with the License.
-//   You may obtain a copy of the License at
-//
-//       http://www.apache.org/licenses/LICENSE-2.0
-//
-//   Unless required by applicable law or agreed to in writing, software
-//   distributed under the License is distributed on an "AS IS" BASIS,
-//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//   See the License for the specific language governing permissions and
-//   limitations under the License.
-
-
-use std::sync::atomic::AtomicPtr;
-use std::sync::Arc;
-use std::mem;
-use std::ptr;
-use std::ops::Deref;
-use std::fmt::{self, Debug, Formatter};
-use std::marker::PhantomData;
-use std::sync::atomic::Ordering;
-
-/// An Atom wraps an AtomicPtr, it allows for safe mutation of an atomic
-/// into common Rust Types.
-pub struct Atom<P> where P: IntoRawPtr + FromRawPtr {
-    inner: AtomicPtr<()>,
-    data: PhantomData<P>
-}
-
-impl<P> Debug for Atom<P> where P: IntoRawPtr + FromRawPtr {
-    fn fmt(&self, f: &mut Formatter) -> Result<(), fmt::Error> {
-        write!(f, "atom({:?})", self.inner.load(Ordering::Relaxed))
-    }
-}
-
-impl<P> Atom<P> where P: IntoRawPtr + FromRawPtr {
-    /// Create a empty Atom
-    pub fn empty() -> Atom<P> {
-        Atom {
-            inner: AtomicPtr::new(ptr::null_mut()),
-            data: PhantomData
-        }
-    }
-
-    /// Create a new Atomic from Pointer P
-    pub fn new(value: P) -> Atom<P> {
-        Atom {
-            inner: AtomicPtr::new(unsafe { value.into_raw() }),
-            data: PhantomData
-        }
-    }
-
-    /// Swap a new value into the Atom, This will try multiple
-    /// times until it succeeds. The old value will be returned.
-    pub fn swap(&self, v: P) -> Option<P> {
-        let new = unsafe { v.into_raw() };
-        let old = self.inner.swap(new, Ordering::AcqRel);
-        if !old.is_null() {
-            Some(unsafe { FromRawPtr::from_raw(old) })
-        } else {
-            None
-        }
-    }
-
-    /// Take the value of the Atom replacing it with null pointer
-    /// Returning the contents. If the contents was a `null` pointer the
-    /// result will be `None`.
-    pub fn take(&self) -> Option<P> {
-        let old = self.inner.swap(ptr::null_mut(), Ordering::Acquire);
-        if !old.is_null() {
-            Some(unsafe { FromRawPtr::from_raw(old) })
-        } else {
-            None
-        }
-    }
-
-    /// This will do a `CAS` setting the value only if it is NULL
-    /// this will return `None` if the value was written,
-    /// otherwise a `Some(v)` will be returned, where the value was
-    /// the same value that you passed into this function
-    pub fn set_if_none(&self, v: P) -> Option<P> {
-        let new = unsafe { v.into_raw() };
-        let old = self.inner.compare_and_swap(ptr::null_mut(), new, Ordering::Release);
-        if !old.is_null() {
-            Some(unsafe { FromRawPtr::from_raw(new) })
-        } else {
-            None
-        }
-    }
-
-    /// Take the current content, write it into P then do a CAS to extent this
-    /// Atom with the previous contents. This can be used to create a LIFO
-    ///
-    /// Returns true if this set this migrated the Atom from null.
-    pub fn replace_and_set_next(&self, mut value: P) -> bool
-        where P: GetNextMut<NextPtr=Option<P>> {
-        unsafe {
-            let next = value.get_next() as *mut Option<P>;
-            let raw = value.into_raw();
-            // Iff next was set to Some(P) we want to 
-            // assert that it was droppeds
-            drop(ptr::read(next));
-            loop {
-                let pcurrent = self.inner.load(Ordering::Relaxed);
-                let current = if pcurrent.is_null() {
-                    None
-                } else {
-                    Some(FromRawPtr::from_raw(pcurrent))
-                };
-                ptr::write(next, current);
-                let last = self.inner.compare_and_swap(pcurrent, raw, Ordering::AcqRel);
-                if last == pcurrent {
-                    return last.is_null();
-                }
-            }
-        }
-    }
-
-    /// Check to see if an atom is None
-    ///
-    /// This only means that the contents was None when it was measured
-    pub fn is_none(&self) -> bool {
-        self.inner.load(Ordering::Relaxed).is_null()
-    }
-}
-
-impl<P> Drop for Atom<P> where P: IntoRawPtr + FromRawPtr  {
-    fn drop(&mut self) {
-        unsafe {
-            let ptr = self.inner.load(Ordering::Relaxed);
-            if !ptr.is_null() {
-                let _: P = FromRawPtr::from_raw(ptr);
-            }
-        }
-    }
-}
-
-unsafe impl<P> Send for Atom<P> where P: IntoRawPtr + FromRawPtr {}
-unsafe impl<P> Sync for Atom<P> where P: IntoRawPtr + FromRawPtr {}
-
-/// Convert from into a raw pointer
-pub trait IntoRawPtr {
-    unsafe fn into_raw(self) -> *mut ();
-}
-
-/// Convert from a raw ptr into a pointer
-pub trait FromRawPtr {
-    unsafe fn from_raw(ptr: *mut ()) -> Self;
-}
-
-impl<T> IntoRawPtr for Box<T> {
-    unsafe fn into_raw(self) -> *mut () {
-        mem::transmute(self)
-    }
-}
-
-impl<T> FromRawPtr for Box<T> {
-    unsafe fn from_raw(ptr: *mut ()) -> Box<T> {
-        mem::transmute(ptr)
-    }
-}
-
-impl<T> IntoRawPtr for Arc<T> {
-    unsafe fn into_raw(self) -> *mut () {
-        mem::transmute(self)
-    }
-}
-
-impl<T> FromRawPtr for Arc<T> {
-    unsafe fn from_raw(ptr: *mut ()) -> Arc<T> {
-        mem::transmute(ptr)
-    }
-}
-
-/// Transforms lifetime of the second pointer to match the first.
-#[inline]
-unsafe fn copy_lifetime<'a, S: ?Sized, T: ?Sized + 'a>(_ptr: &'a S, 
-                                                       ptr: &T) -> &'a T {
-    mem::transmute(ptr)
-}
-
-
-/// Transforms lifetime of the second pointer to match the first.
-#[inline]
-unsafe fn copy_mut_lifetime<'a, S: ?Sized, T: ?Sized + 'a>(_ptr: &'a S, 
-                                                    ptr: &mut T) -> &'a mut T {
-    mem::transmute(ptr)
-}
-
-
-/// This is a restricted version of the Atom. It allows for only
-/// `set_if_none` to be called.
-///
-/// `swap` and `take` can be used only with a mutable reference. Meaning
-/// that AtomSetOnce is not usable as a 
-#[derive(Debug)]
-pub struct AtomSetOnce<P> where P: IntoRawPtr + FromRawPtr {
-    inner: Atom<P>
-}
-
-impl<P> AtomSetOnce<P>
-    where P: IntoRawPtr + FromRawPtr {
-
-    /// Create a empty AtomSetOnce
-    pub fn empty() -> AtomSetOnce<P> {
-        AtomSetOnce { inner: Atom::empty() }
-    }
-
-    /// Create a new AtomSetOnce from Pointer P
-    pub fn new(value: P) -> AtomSetOnce<P> {
-        AtomSetOnce { inner: Atom::new(value) }
-    }
-
-    /// This will do a `CAS` setting the value only if it is NULL
-    /// this will return `OK(())` if the value was written,
-    /// otherwise a `Err(P)` will be returned, where the value was
-    /// the same value that you passed into this function
-    pub fn set_if_none(&self, v: P) -> Option<P> {
-        self.inner.set_if_none(v)
-    }
-
-    /// Convert an AtomSetOnce into an Atom
-    pub fn into_atom(self) -> Atom<P> { self.inner }
-
-    /// Allow access to the atom if exclusive access is granted
-    pub fn atom(&mut self) -> &mut Atom<P> { &mut self.inner }
-
-    /// Check to see if an atom is None
-    ///
-    /// This only means that the contents was None when it was measured
-    pub fn is_none(&self) -> bool { self.inner.is_none() }
-}
-
-impl<T, P> AtomSetOnce<P>
-    where P: IntoRawPtr + FromRawPtr + Deref<Target=T> {
-
-    /// If the Atom is set, get the value
-    pub fn get<'a>(&'a self) -> Option<&'a T> {
-        let ptr = self.inner.inner.load(Ordering::Acquire);
-        if ptr.is_null() {
-            None
-        } else {
-            unsafe {
-                // This is safe since ptr cannot be changed once it is set
-                // which means that this is now a Arc or a Box.
-                let v: P = FromRawPtr::from_raw(ptr);
-                let out = copy_lifetime(self, &*v);
-                mem::forget(v);
-                Some(out)
-            }
-        }
-    }
-}
-
-impl<T> AtomSetOnce<Box<T>> {
-    /// If the Atom is set, get the value
-    pub fn get_mut<'a>(&'a mut self) -> Option<&'a mut T> {
-        let ptr = self.inner.inner.load(Ordering::Acquire);
-        if ptr.is_null() {
-            None
-        } else {
-            unsafe {
-                // This is safe since ptr cannot be changed once it is set
-                // which means that this is now a Arc or a Box.
-                let mut v: Box<T> = FromRawPtr::from_raw(ptr);
-                let out = copy_mut_lifetime(self, &mut *v);
-                mem::forget(v);
-                Some(out)
-            }
-        }
-    }
-}
-
-impl<T> AtomSetOnce<T> where T: Clone+IntoRawPtr+FromRawPtr {
-    /// Duplicate the inner pointer if it is set
-    pub fn dup<'a>(&self) -> Option<T> {
-        let ptr = self.inner.inner.load(Ordering::Acquire);
-        if ptr.is_null() {
-            None
-        } else {
-            unsafe {
-                // This is safe since ptr cannot be changed once it is set
-                // which means that this is now a Arc or a Box.
-                let v: T = FromRawPtr::from_raw(ptr);
-                let out = v.clone();
-                mem::forget(v);
-                Some(out)
-            }
-        }
-    }
-}
-
-/// This is a utility Trait that fetches the next ptr from
-/// an object.
-pub trait GetNextMut {
-    type NextPtr;
-    fn get_next(&mut self) -> &mut Self::NextPtr;
-}
diff --git a/vendor/atom/tests/atom.rs b/vendor/atom/tests/atom.rs
deleted file mode 100644
index 741b86b..0000000
--- a/vendor/atom/tests/atom.rs
+++ /dev/null
@@ -1,189 +0,0 @@
-//   Copyright 2015 Colin Sherratt
-//
-//   Licensed under the Apache License, Version 2.0 (the "License");
-//   you may not use this file except in compliance with the License.
-//   You may obtain a copy of the License at
-//
-//       http://www.apache.org/licenses/LICENSE-2.0
-//
-//   Unless required by applicable law or agreed to in writing, software
-//   distributed under the License is distributed on an "AS IS" BASIS,
-//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//   See the License for the specific language governing permissions and
-//   limitations under the License.
-
-extern crate atom;
-
-use std::thread;
-use std::sync::*;
-use std::sync::atomic::AtomicUsize;
-use std::sync::atomic::Ordering;
-use atom::*;
-
-#[test]
-fn swap() {
-    let a = Atom::empty();
-    assert_eq!(a.swap(Box::new(1u8)), None);
-    assert_eq!(a.swap(Box::new(2u8)), Some(Box::new(1u8)));
-    assert_eq!(a.swap(Box::new(3u8)), Some(Box::new(2u8)));
-}
-
-#[test]
-fn take() {
-    let a = Atom::new(Box::new(7u8));
-    assert_eq!(a.take(), Some(Box::new(7)));
-    assert_eq!(a.take(), None);
-}
-
-#[test]
-fn set_if_none() {
-    let a = Atom::empty();
-    assert_eq!(a.set_if_none(Box::new(7u8)), None);
-    assert_eq!(a.set_if_none(Box::new(8u8)), Some(Box::new(8u8)));
-}
-
-#[derive(Clone)]
-struct Canary(Arc<AtomicUsize>);
-
-impl Drop for Canary {
-    fn drop(&mut self) {
-        self.0.fetch_add(1, Ordering::SeqCst);
-    }
-}
-
-#[test]
-fn ensure_drop() {
-    let v = Arc::new(AtomicUsize::new(0));
-    let a = Box::new(Canary(v.clone()));
-    let a = Atom::new(a);
-    assert_eq!(v.load(Ordering::SeqCst), 0);
-    drop(a);
-    assert_eq!(v.load(Ordering::SeqCst), 1);
-}
-
-#[test]
-fn ensure_drop_arc() {
-    let v = Arc::new(AtomicUsize::new(0));
-    let a = Arc::new(Canary(v.clone()));
-    let a = Atom::new(a);
-    assert_eq!(v.load(Ordering::SeqCst), 0);
-    drop(a);
-    assert_eq!(v.load(Ordering::SeqCst), 1);
-}
-
-#[test]
-fn ensure_send() {
-    let atom = Arc::new(Atom::empty());
-    let wait = Arc::new(Barrier::new(2));
-
-    let w = wait.clone();
-    let a = atom.clone();
-    thread::spawn(move || {
-        a.swap(Box::new(7u8));
-        w.wait();
-    });
-
-    wait.wait();
-    assert_eq!(atom.take(), Some(Box::new(7u8)));
-}
-
-#[test]
-fn get() {
-    let atom = Arc::new(AtomSetOnce::empty());
-    assert_eq!(atom.get(), None);
-    assert_eq!(atom.set_if_none(Box::new(8u8)), None);
-    assert_eq!(atom.get(), Some(&8u8));
-}
-
-#[test]
-fn get_arc() {
-    let atom = Arc::new(AtomSetOnce::empty());
-    assert_eq!(atom.get(), None);
-    assert_eq!(atom.set_if_none(Arc::new(8u8)), None);
-    assert_eq!(atom.get(), Some(&8u8));
-
-    let v = Arc::new(AtomicUsize::new(0));
-    let atom = Arc::new(AtomSetOnce::empty());
-    atom.get();
-    atom.set_if_none(Arc::new(Canary(v.clone())));
-    atom.get();
-    drop(atom);
-
-    assert_eq!(v.load(Ordering::SeqCst), 1);
-}
-
-#[derive(Debug)]
-struct Link {
-    next: Option<Box<Link>>,
-    value: u32
-}
-
-impl Link {
-    fn new(v: u32) -> Box<Link> {
-        Box::new(Link{
-            next: None,
-            value: v
-        })
-    }
-}
-
-impl GetNextMut for Box<Link> {
-    type NextPtr = Option<Box<Link>>;
-    fn get_next(&mut self) -> &mut Option<Box<Link>> {
-        &mut self.next
-    }
-}
-
-#[test]
-fn lifo() {
-    let atom = Atom::empty();
-    for i in 0..100 {
-        let x = atom.replace_and_set_next(Link::new(99-i));
-        assert_eq!(x, i == 0);
-    }
-
-    let expected: Vec<u32> = (0..100).collect();
-    let mut found = Vec::new();
-    let mut chain = atom.take();
-    while let Some(v) = chain {
-        found.push(v.value);
-        chain = v.next;
-    }
-    assert_eq!(expected, found);
-}
-
-#[allow(dead_code)]
-struct LinkCanary {
-    next: Option<Box<LinkCanary>>,
-    value: Canary
-}
-
-impl LinkCanary {
-    fn new(v: Canary) -> Box<LinkCanary> {
-        Box::new(LinkCanary{
-            next: None,
-            value: v
-        })
-    }
-}
-
-impl GetNextMut for Box<LinkCanary> {
-    type NextPtr = Option<Box<LinkCanary>>;
-    fn get_next(&mut self) -> &mut Option<Box<LinkCanary>> {
-        &mut self.next
-    }
-}
-
-#[test]
-fn lifo_drop() {
-    let v = Arc::new(AtomicUsize::new(0));
-    let canary = Canary(v.clone());
-    let mut link = LinkCanary::new(canary.clone());
-    link.next = Some(LinkCanary::new(canary.clone()));
-
-    let atom = Atom::empty();
-    atom.replace_and_set_next(link);
-    assert_eq!(1, v.load(Ordering::SeqCst));
-    drop(atom);
-    assert_eq!(2, v.load(Ordering::SeqCst));
-}
\ No newline at end of file
diff --git a/vendor/getopts/.cargo-checksum.json b/vendor/getopts/.cargo-checksum.json
new file mode 100644
index 0000000..7516360
--- /dev/null
+++ b/vendor/getopts/.cargo-checksum.json
@@ -0,0 +1 @@
+{"files":{".travis.yml":"9bd13f3af0ba30109de76084b2919d8a833ccad8d2af09d74e881ddbef62ab78","Cargo.toml":"88427e1c4c50b24ad565317e5d72ebedf31727ebb58171e17e02ca14ef3c8a48","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"7444d1eefe435deeac9f2726964ec2b6710047507f4e395106bf7972795a0811","appveyor.yml":"da991211b72fa6f231af7adb84c9fb72f5a9131d1c0a3d47b8ceffe5a82c8542","src/lib.rs":"3e0fec082c51f22f0bc656fab1a10c12509c2258f6095d280e8facbe2e52a2ed","tests/smoke.rs":"26a95ac42e42b766ae752fe8531fb740fd147d5cdff352dec0763d175ce91806"},"package":"b900c08c1939860ce8b54dc6a89e26e00c04c380fd0e09796799bd7f12861e05"}
\ No newline at end of file
diff --git a/vendor/getopts/.travis.yml b/vendor/getopts/.travis.yml
new file mode 100644
index 0000000..9a68a89
--- /dev/null
+++ b/vendor/getopts/.travis.yml
@@ -0,0 +1,21 @@
+language: rust
+rust:
+  - stable
+  - beta
+  - nightly
+sudo: false
+before_script:
+  - pip install 'travis-cargo<0.2' --user && export PATH=$HOME/.local/bin:$PATH
+script:
+  - cargo build --verbose
+  - cargo test --verbose
+  - cargo doc --no-deps
+after_success:
+  - travis-cargo --only nightly doc-upload
+env:
+  global:
+    secure: "v7JYTHRJff4zKegaYmbqCZd3/dGAgRwPyLIvM9rRy92rUhv5eCQqsNMR3r9SYR/h7fiSLqLiQi06WmhY5i+pLG9q0Ga2YhqsVBskj5tCGk6NrzmnNKjQTyJ4Go/U8GXZRyknKOuU71e8A0RJVI2FbhQwFvnOp1KArJqgVU5/WL8="
+
+notifications:
+  email:
+    on_success: never
diff --git a/vendor/getopts/Cargo.toml b/vendor/getopts/Cargo.toml
new file mode 100644
index 0000000..d231883
--- /dev/null
+++ b/vendor/getopts/Cargo.toml
@@ -0,0 +1,25 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g. crates.io) dependencies
+#
+# If you believe there's an error in this file please file an
+# issue against the rust-lang/cargo repository. If you're
+# editing this file be aware that the upstream Cargo.toml
+# will likely look very different (and much more reasonable)
+
+[package]
+name = "getopts"
+version = "0.2.17"
+authors = ["The Rust Project Developers"]
+description = "getopts-like option parsing.\n"
+homepage = "https://github.com/rust-lang/getopts"
+documentation = "https://doc.rust-lang.org/getopts"
+readme = "README.md"
+categories = ["command-line-interface"]
+license = "MIT/Apache-2.0"
+repository = "https://github.com/rust-lang/getopts"
+[dev-dependencies.log]
+version = "0.3"
diff --git a/vendor/getopts/LICENSE-APACHE b/vendor/getopts/LICENSE-APACHE
new file mode 100644
index 0000000..16fe87b
--- /dev/null
+++ b/vendor/getopts/LICENSE-APACHE
@@ -0,0 +1,201 @@
+                              Apache License
+                        Version 2.0, January 2004
+                     http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+   "License" shall mean the terms and conditions for use, reproduction,
+   and distribution as defined by Sections 1 through 9 of this document.
+
+   "Licensor" shall mean the copyright owner or entity authorized by
+   the copyright owner that is granting the License.
+
+   "Legal Entity" shall mean the union of the acting entity and all
+   other entities that control, are controlled by, or are under common
+   control with that entity. For the purposes of this definition,
+   "control" means (i) the power, direct or indirect, to cause the
+   direction or management of such entity, whether by contract or
+   otherwise, or (ii) ownership of fifty percent (50%) or more of the
+   outstanding shares, or (iii) beneficial ownership of such entity.
+
+   "You" (or "Your") shall mean an individual or Legal Entity
+   exercising permissions granted by this License.
+
+   "Source" form shall mean the preferred form for making modifications,
+   including but not limited to software source code, documentation
+   source, and configuration files.
+
+   "Object" form shall mean any form resulting from mechanical
+   transformation or translation of a Source form, including but
+   not limited to compiled object code, generated documentation,
+   and conversions to other media types.
+
+   "Work" shall mean the work of authorship, whether in Source or
+   Object form, made available under the License, as indicated by a
+   copyright notice that is included in or attached to the work
+   (an example is provided in the Appendix below).
+
+   "Derivative Works" shall mean any work, whether in Source or Object
+   form, that is based on (or derived from) the Work and for which the
+   editorial revisions, annotations, elaborations, or other modifications
+   represent, as a whole, an original work of authorship. For the purposes
+   of this License, Derivative Works shall not include works that remain
+   separable from, or merely link (or bind by name) to the interfaces of,
+   the Work and Derivative Works thereof.
+
+   "Contribution" shall mean any work of authorship, including
+   the original version of the Work and any modifications or additions
+   to that Work or Derivative Works thereof, that is intentionally
+   submitted to Licensor for inclusion in the Work by the copyright owner
+   or by an individual or Legal Entity authorized to submit on behalf of
+   the copyright owner. For the purposes of this definition, "submitted"
+   means any form of electronic, verbal, or written communication sent
+   to the Licensor or its representatives, including but not limited to
+   communication on electronic mailing lists, source code control systems,
+   and issue tracking systems that are managed by, or on behalf of, the
+   Licensor for the purpose of discussing and improving the Work, but
+   excluding communication that is conspicuously marked or otherwise
+   designated in writing by the copyright owner as "Not a Contribution."
+
+   "Contributor" shall mean Licensor and any individual or Legal Entity
+   on behalf of whom a Contribution has been received by Licensor and
+   subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+   this License, each Contributor hereby grants to You a perpetual,
+   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+   copyright license to reproduce, prepare Derivative Works of,
+   publicly display, publicly perform, sublicense, and distribute the
+   Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+   this License, each Contributor hereby grants to You a perpetual,
+   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+   (except as stated in this section) patent license to make, have made,
+   use, offer to sell, sell, import, and otherwise transfer the Work,
+   where such license applies only to those patent claims licensable
+   by such Contributor that are necessarily infringed by their
+   Contribution(s) alone or by combination of their Contribution(s)
+   with the Work to which such Contribution(s) was submitted. If You
+   institute patent litigation against any entity (including a
+   cross-claim or counterclaim in a lawsuit) alleging that the Work
+   or a Contribution incorporated within the Work constitutes direct
+   or contributory patent infringement, then any patent licenses
+   granted to You under this License for that Work shall terminate
+   as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+   Work or Derivative Works thereof in any medium, with or without
+   modifications, and in Source or Object form, provided that You
+   meet the following conditions:
+
+   (a) You must give any other recipients of the Work or
+       Derivative Works a copy of this License; and
+
+   (b) You must cause any modified files to carry prominent notices
+       stating that You changed the files; and
+
+   (c) You must retain, in the Source form of any Derivative Works
+       that You distribute, all copyright, patent, trademark, and
+       attribution notices from the Source form of the Work,
+       excluding those notices that do not pertain to any part of
+       the Derivative Works; and
+
+   (d) If the Work includes a "NOTICE" text file as part of its
+       distribution, then any Derivative Works that You distribute must
+       include a readable copy of the attribution notices contained
+       within such NOTICE file, excluding those notices that do not
+       pertain to any part of the Derivative Works, in at least one
+       of the following places: within a NOTICE text file distributed
+       as part of the Derivative Works; within the Source form or
+       documentation, if provided along with the Derivative Works; or,
+       within a display generated by the Derivative Works, if and
+       wherever such third-party notices normally appear. The contents
+       of the NOTICE file are for informational purposes only and
+       do not modify the License. You may add Your own attribution
+       notices within Derivative Works that You distribute, alongside
+       or as an addendum to the NOTICE text from the Work, provided
+       that such additional attribution notices cannot be construed
+       as modifying the License.
+
+   You may add Your own copyright statement to Your modifications and
+   may provide additional or different license terms and conditions
+   for use, reproduction, or distribution of Your modifications, or
+   for any such Derivative Works as a whole, provided Your use,
+   reproduction, and distribution of the Work otherwise complies with
+   the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+   any Contribution intentionally submitted for inclusion in the Work
+   by You to the Licensor shall be under the terms and conditions of
+   this License, without any additional terms or conditions.
+   Notwithstanding the above, nothing herein shall supersede or modify
+   the terms of any separate license agreement you may have executed
+   with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+   names, trademarks, service marks, or product names of the Licensor,
+   except as required for reasonable and customary use in describing the
+   origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+   agreed to in writing, Licensor provides the Work (and each
+   Contributor provides its Contributions) on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+   implied, including, without limitation, any warranties or conditions
+   of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+   PARTICULAR PURPOSE. You are solely responsible for determining the
+   appropriateness of using or redistributing the Work and assume any
+   risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+   whether in tort (including negligence), contract, or otherwise,
+   unless required by applicable law (such as deliberate and grossly
+   negligent acts) or agreed to in writing, shall any Contributor be
+   liable to You for damages, including any direct, indirect, special,
+   incidental, or consequential damages of any character arising as a
+   result of this License or out of the use or inability to use the
+   Work (including but not limited to damages for loss of goodwill,
+   work stoppage, computer failure or malfunction, or any and all
+   other commercial damages or losses), even if such Contributor
+   has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+   the Work or Derivative Works thereof, You may choose to offer,
+   and charge a fee for, acceptance of support, warranty, indemnity,
+   or other liability obligations and/or rights consistent with this
+   License. However, in accepting such obligations, You may act only
+   on Your own behalf and on Your sole responsibility, not on behalf
+   of any other Contributor, and only if You agree to indemnify,
+   defend, and hold each Contributor harmless for any liability
+   incurred by, or claims asserted against, such Contributor by reason
+   of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work.
+
+   To apply the Apache License to your work, attach the following
+   boilerplate notice, with the fields enclosed by brackets "[]"
+   replaced with your own identifying information. (Don't include
+   the brackets!)  The text should be enclosed in the appropriate
+   comment syntax for the file format. We also recommend that a
+   file or class name and description of purpose be included on the
+   same "printed page" as the copyright notice for easier
+   identification within third-party archives.
+
+Copyright [yyyy] [name of copyright owner]
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+	http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
diff --git a/vendor/getopts/LICENSE-MIT b/vendor/getopts/LICENSE-MIT
new file mode 100644
index 0000000..39d4bdb
--- /dev/null
+++ b/vendor/getopts/LICENSE-MIT
@@ -0,0 +1,25 @@
+Copyright (c) 2014 The Rust Project Developers
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/vendor/getopts/README.md b/vendor/getopts/README.md
new file mode 100644
index 0000000..4e85020
--- /dev/null
+++ b/vendor/getopts/README.md
@@ -0,0 +1,23 @@
+getopts
+===
+
+A Rust library for option parsing for CLI utilities.
+
+[![Build Status](https://travis-ci.org/rust-lang-nursery/getopts.svg?branch=master)](https://travis-ci.org/rust-lang-nursery/getopts)
+
+[Documentation](https://doc.rust-lang.org/getopts)
+
+## Usage
+
+Add this to your `Cargo.toml`:
+
+```toml
+[dependencies]
+getopts = "0.2"
+```
+
+and this to your crate root:
+
+```rust
+extern crate getopts;
+```
diff --git a/vendor/getopts/appveyor.yml b/vendor/getopts/appveyor.yml
new file mode 100644
index 0000000..6a1b8dc
--- /dev/null
+++ b/vendor/getopts/appveyor.yml
@@ -0,0 +1,17 @@
+environment:
+  matrix:
+  - TARGET: x86_64-pc-windows-msvc
+  - TARGET: i686-pc-windows-msvc
+  - TARGET: i686-pc-windows-gnu
+install:
+  - ps: Start-FileDownload "https://static.rust-lang.org/dist/rust-nightly-${env:TARGET}.exe"
+  - rust-nightly-%TARGET%.exe /VERYSILENT /NORESTART /DIR="C:\Program Files (x86)\Rust"
+  - SET PATH=%PATH%;C:\Program Files (x86)\Rust\bin
+  - SET PATH=%PATH%;C:\MinGW\bin
+  - rustc -V
+  - cargo -V
+
+build: false
+
+test_script:
+  - cargo test --verbose
diff --git a/vendor/getopts/src/lib.rs b/vendor/getopts/src/lib.rs
new file mode 100644
index 0000000..fa804bf
--- /dev/null
+++ b/vendor/getopts/src/lib.rs
@@ -0,0 +1,2009 @@
+// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+//
+// ignore-lexer-test FIXME #15677
+
+//! Simple getopt alternative.
+//!
+//! Construct a vector of options, either by using `reqopt`, `optopt`, and
+//! `optflag` or by building them from components yourself, and pass them to
+//! `getopts`, along with a vector of actual arguments (not including
+//! `argv[0]`). You'll either get a failure code back, or a match. You'll have
+//! to verify whether the amount of 'free' arguments in the match is what you
+//! expect. Use `opt_*` accessors to get argument values out of the matches
+//! object.
+//!
+//! Single-character options are expected to appear on the command line with a
+//! single preceding dash; multiple-character options are expected to be
+//! proceeded by two dashes. Options that expect an argument accept their
+//! argument following either a space or an equals sign. Single-character
+//! options don't require the space.
+//!
+//! # Usage
+//!
+//! This crate is [on crates.io](https://crates.io/crates/getopts) and can be
+//! used by adding `getopts` to the dependencies in your project's `Cargo.toml`.
+//!
+//! ```toml
+//! [dependencies]
+//! getopts = "0.2"
+//! ```
+//!
+//! and this to your crate root:
+//!
+//! ```rust
+//! extern crate getopts;
+//! ```
+//!
+//! # Example
+//!
+//! The following example shows simple command line parsing for an application
+//! that requires an input file to be specified, accepts an optional output file
+//! name following `-o`, and accepts both `-h` and `--help` as optional flags.
+//!
+//! ```{.rust}
+//! extern crate getopts;
+//! use getopts::Options;
+//! use std::env;
+//!
+//! fn do_work(inp: &str, out: Option<String>) {
+//!     println!("{}", inp);
+//!     match out {
+//!         Some(x) => println!("{}", x),
+//!         None => println!("No Output"),
+//!     }
+//! }
+//!
+//! fn print_usage(program: &str, opts: Options) {
+//!     let brief = format!("Usage: {} FILE [options]", program);
+//!     print!("{}", opts.usage(&brief));
+//! }
+//!
+//! fn main() {
+//!     let args: Vec<String> = env::args().collect();
+//!     let program = args[0].clone();
+//!
+//!     let mut opts = Options::new();
+//!     opts.optopt("o", "", "set output file name", "NAME");
+//!     opts.optflag("h", "help", "print this help menu");
+//!     let matches = match opts.parse(&args[1..]) {
+//!         Ok(m) => { m }
+//!         Err(f) => { panic!(f.to_string()) }
+//!     };
+//!     if matches.opt_present("h") {
+//!         print_usage(&program, opts);
+//!         return;
+//!     }
+//!     let output = matches.opt_str("o");
+//!     let input = if !matches.free.is_empty() {
+//!         matches.free[0].clone()
+//!     } else {
+//!         print_usage(&program, opts);
+//!         return;
+//!     };
+//!     do_work(&input, output);
+//! }
+//! ```
+
+#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
+       html_favicon_url = "https://www.rust-lang.org/favicon.ico",
+       html_root_url = "https://doc.rust-lang.org/getopts/")]
+#![deny(missing_docs)]
+#![cfg_attr(test, deny(warnings))]
+#![cfg_attr(rust_build, feature(staged_api))]
+#![cfg_attr(rust_build, staged_api)]
+#![cfg_attr(rust_build,
+            unstable(feature = "rustc_private",
+                     reason = "use the crates.io `getopts` library instead"))]
+
+#[cfg(test)] #[macro_use] extern crate log;
+
+use self::Name::*;
+use self::HasArg::*;
+use self::Occur::*;
+use self::Fail::*;
+use self::Optval::*;
+use self::SplitWithinState::*;
+use self::Whitespace::*;
+use self::LengthLimit::*;
+
+use std::error::Error;
+use std::ffi::OsStr;
+use std::fmt;
+use std::iter::{repeat, IntoIterator};
+use std::result;
+
+/// A description of the options that a program can handle.
+pub struct Options {
+    grps: Vec<OptGroup>,
+    parsing_style : ParsingStyle,
+    long_only: bool
+}
+
+impl Options {
+    /// Create a blank set of options.
+    pub fn new() -> Options {
+        Options {
+            grps: Vec::new(),
+            parsing_style: ParsingStyle::FloatingFrees,
+            long_only: false
+        }
+    }
+
+    /// Set the parsing style.
+    pub fn parsing_style(&mut self, style: ParsingStyle) -> &mut Options {
+        self.parsing_style = style;
+        self
+    }
+
+    /// Set or clear "long options only" mode.
+    ///
+    /// In "long options only" mode, short options cannot be clustered
+    /// together, and long options can be given with either a single
+    /// "-" or the customary "--".  This mode also changes the meaning
+    /// of "-a=b"; in the ordinary mode this will parse a short option
+    /// "-a" with argument "=b"; whereas in long-options-only mode the
+    /// argument will be simply "b".
+    pub fn long_only(&mut self, long_only: bool) -> &mut Options {
+        self.long_only = long_only;
+        self
+    }
+
+    /// Create a generic option group, stating all parameters explicitly.
+    pub fn opt(&mut self, short_name: &str, long_name: &str, desc: &str,
+                       hint: &str, hasarg: HasArg, occur: Occur) -> &mut Options {
+        validate_names(short_name, long_name);
+        self.grps.push(OptGroup {
+            short_name: short_name.to_string(),
+            long_name: long_name.to_string(),
+            hint: hint.to_string(),
+            desc: desc.to_string(),
+            hasarg: hasarg,
+            occur: occur
+        });
+        self
+    }
+
+    /// Create a long option that is optional and does not take an argument.
+    ///
+    /// * `short_name` - e.g. `"h"` for a `-h` option, or `""` for none
+    /// * `long_name` - e.g. `"help"` for a `--help` option, or `""` for none
+    /// * `desc` - Description for usage help
+    pub fn optflag(&mut self, short_name: &str, long_name: &str, desc: &str)
+                           -> &mut Options {
+        validate_names(short_name, long_name);
+        self.grps.push(OptGroup {
+            short_name: short_name.to_string(),
+            long_name: long_name.to_string(),
+            hint: "".to_string(),
+            desc: desc.to_string(),
+            hasarg: No,
+            occur: Optional
+        });
+        self
+    }
+
+    /// Create a long option that can occur more than once and does not
+    /// take an argument.
+    ///
+    /// * `short_name` - e.g. `"h"` for a `-h` option, or `""` for none
+    /// * `long_name` - e.g. `"help"` for a `--help` option, or `""` for none
+    /// * `desc` - Description for usage help
+    pub fn optflagmulti(&mut self, short_name: &str, long_name: &str, desc: &str)
+                                -> &mut Options {
+        validate_names(short_name, long_name);
+        self.grps.push(OptGroup {
+            short_name: short_name.to_string(),
+            long_name: long_name.to_string(),
+            hint: "".to_string(),
+            desc: desc.to_string(),
+            hasarg: No,
+            occur: Multi
+        });
+        self
+    }
+
+    /// Create a long option that is optional and takes an optional argument.
+    ///
+    /// * `short_name` - e.g. `"h"` for a `-h` option, or `""` for none
+    /// * `long_name` - e.g. `"help"` for a `--help` option, or `""` for none
+    /// * `desc` - Description for usage help
+    /// * `hint` - Hint that is used in place of the argument in the usage help,
+    ///   e.g. `"FILE"` for a `-o FILE` option
+    pub fn optflagopt(&mut self, short_name: &str, long_name: &str, desc: &str,
+                              hint: &str) -> &mut Options {
+        validate_names(short_name, long_name);
+        self.grps.push(OptGroup {
+            short_name: short_name.to_string(),
+            long_name: long_name.to_string(),
+            hint: hint.to_string(),
+            desc: desc.to_string(),
+            hasarg: Maybe,
+            occur: Optional
+        });
+        self
+    }
+
+    /// Create a long option that is optional, takes an argument, and may occur
+    /// multiple times.
+    ///
+    /// * `short_name` - e.g. `"h"` for a `-h` option, or `""` for none
+    /// * `long_name` - e.g. `"help"` for a `--help` option, or `""` for none
+    /// * `desc` - Description for usage help
+    /// * `hint` - Hint that is used in place of the argument in the usage help,
+    ///   e.g. `"FILE"` for a `-o FILE` option
+    pub fn optmulti(&mut self, short_name: &str, long_name: &str, desc: &str, hint: &str)
+                            -> &mut Options {
+        validate_names(short_name, long_name);
+        self.grps.push(OptGroup {
+            short_name: short_name.to_string(),
+            long_name: long_name.to_string(),
+            hint: hint.to_string(),
+            desc: desc.to_string(),
+            hasarg: Yes,
+            occur: Multi
+        });
+        self
+    }
+
+    /// Create a long option that is optional and takes an argument.
+    ///
+    /// * `short_name` - e.g. `"h"` for a `-h` option, or `""` for none
+    /// * `long_name` - e.g. `"help"` for a `--help` option, or `""` for none
+    /// * `desc` - Description for usage help
+    /// * `hint` - Hint that is used in place of the argument in the usage help,
+    ///   e.g. `"FILE"` for a `-o FILE` option
+    pub fn optopt(&mut self, short_name: &str, long_name: &str, desc: &str, hint: &str)
+                          -> &mut Options {
+        validate_names(short_name, long_name);
+        self.grps.push(OptGroup {
+            short_name: short_name.to_string(),
+            long_name: long_name.to_string(),
+            hint: hint.to_string(),
+            desc: desc.to_string(),
+            hasarg: Yes,
+            occur: Optional
+        });
+        self
+    }
+
+    /// Create a long option that is required and takes an argument.
+    ///
+    /// * `short_name` - e.g. `"h"` for a `-h` option, or `""` for none
+    /// * `long_name` - e.g. `"help"` for a `--help` option, or `""` for none
+    /// * `desc` - Description for usage help
+    /// * `hint` - Hint that is used in place of the argument in the usage help,
+    ///   e.g. `"FILE"` for a `-o FILE` option
+    pub fn reqopt(&mut self, short_name: &str, long_name: &str, desc: &str, hint: &str)
+                          -> &mut Options {
+        validate_names(short_name, long_name);
+        self.grps.push(OptGroup {
+            short_name: short_name.to_string(),
+            long_name: long_name.to_string(),
+            hint: hint.to_string(),
+            desc: desc.to_string(),
+            hasarg: Yes,
+            occur: Req
+        });
+        self
+    }
+
+    /// Parse command line arguments according to the provided options.
+    ///
+    /// On success returns `Ok(Matches)`. Use methods such as `opt_present`
+    /// `opt_str`, etc. to interrogate results.
+    /// # Panics
+    ///
+    /// Returns `Err(Fail)` on failure: use the `Debug` implementation of `Fail`
+    /// to display information about it.
+    pub fn parse<C: IntoIterator>(&self, args: C) -> Result
+        where C::Item: AsRef<OsStr>
+    {
+        let opts: Vec<Opt> = self.grps.iter().map(|x| x.long_to_short()).collect();
+
+        let mut vals = (0 .. opts.len()).map(|_| Vec::new()).collect::<Vec<Vec<Optval>>>();
+        let mut free: Vec<String> = Vec::new();
+        let args = args.into_iter().map(|i| {
+            i.as_ref().to_str().ok_or_else(|| {
+                Fail::UnrecognizedOption(format!("{:?}", i.as_ref()))
+            }).map(|s| s.to_owned())
+        }).collect::<::std::result::Result<Vec<_>,_>>()?;
+        let mut args = args.into_iter().peekable();
+        while let Some(cur) = args.next() {
+            if !is_arg(&cur) {
+                free.push(cur);
+                match self.parsing_style {
+                    ParsingStyle::FloatingFrees => {},
+                    ParsingStyle::StopAtFirstFree => {
+                        free.extend(args);
+                        break;
+                    }
+                }
+            } else if cur == "--" {
+                free.extend(args);
+                break;
+            } else {
+                let mut names;
+                let mut i_arg = None;
+                let mut was_long = true;
+                if cur.as_bytes()[1] == b'-' || self.long_only {
+                    let tail = if cur.as_bytes()[1] == b'-' {
+                        &cur[2..]
+                    } else {
+                        assert!(self.long_only);
+                        &cur[1..]
+                    };
+                    let mut parts = tail.splitn(2, '=');
+                    names = vec![Name::from_str(parts.next().unwrap())];
+                    if let Some(rest) = parts.next() {
+                        i_arg = Some(rest.to_string());
+                    }
+                } else {
+                    was_long = false;
+                    names = Vec::new();
+                    for (j, ch) in cur.char_indices().skip(1) {
+                        let opt = Short(ch);
+
+                        /* In a series of potential options (eg. -aheJ), if we
+                           see one which takes an argument, we assume all
+                           subsequent characters make up the argument. This
+                           allows options such as -L/usr/local/lib/foo to be
+                           interpreted correctly
+                        */
+
+                        let opt_id = match find_opt(&opts, &opt) {
+                          Some(id) => id,
+                          None => return Err(UnrecognizedOption(opt.to_string()))
+                        };
+
+                        names.push(opt);
+
+                        let arg_follows = match opts[opt_id].hasarg {
+                            Yes | Maybe => true,
+                            No => false
+                        };
+
+                        if arg_follows {
+                            let next = j + ch.len_utf8();
+                            if next < cur.len() {
+                                i_arg = Some(cur[next..].to_string());
+                                break;
+                            }
+                        }
+                    }
+                }
+                let mut name_pos = 0;
+                for nm in names.iter() {
+                    name_pos += 1;
+                    let optid = match find_opt(&opts, &nm) {
+                      Some(id) => id,
+                      None => return Err(UnrecognizedOption(nm.to_string()))
+                    };
+                    match opts[optid].hasarg {
+                      No => {
+                        if name_pos == names.len() && !i_arg.is_none() {
+                            return Err(UnexpectedArgument(nm.to_string()));
+                        }
+                        vals[optid].push(Given);
+                      }
+                      Maybe => {
+                        // Note that here we do not handle `--arg value`.
+                        // This matches GNU getopt behavior; but also
+                        // makes sense, because if this were accepted,
+                        // then users could only write a "Maybe" long
+                        // option at the end of the arguments when
+                        // FloatingFrees is in use.
+                        if let Some(i_arg) = i_arg.take() {
+                            vals[optid].push(Val(i_arg));
+                        } else if was_long || name_pos < names.len() || args.peek().map_or(true, |n| is_arg(&n)) {
+                            vals[optid].push(Given);
+                        } else {
+                            vals[optid].push(Val(args.next().unwrap()));
+                        }
+                      }
+                      Yes => {
+                        if let Some(i_arg) = i_arg.take() {
+                            vals[optid].push(Val(i_arg));
+                        } else if let Some(n) = args.next() {
+                            vals[optid].push(Val(n));
+                        } else {
+                            return Err(ArgumentMissing(nm.to_string()));
+                        }
+                      }
+                    }
+                }
+            }
+        }
+        debug_assert_eq!(vals.len(), opts.len());
+        for (vals, opt) in vals.iter().zip(opts.iter()) {
+            if opt.occur == Req && vals.is_empty() {
+                return Err(OptionMissing(opt.name.to_string()));
+            }
+            if opt.occur != Multi && vals.len() > 1 {
+                return Err(OptionDuplicated(opt.name.to_string()));
+            }
+        }
+        Ok(Matches {
+            opts: opts,
+            vals: vals,
+            free: free
+        })
+    }
+
+    /// Derive a short one-line usage summary from a set of long options.
+    pub fn short_usage(&self, program_name: &str) -> String {
+        let mut line = format!("Usage: {} ", program_name);
+        line.push_str(&self.grps.iter()
+                           .map(format_option)
+                           .collect::<Vec<String>>()
+                           .join(" "));
+        line
+    }
+
+
+    /// Derive a formatted message from a set of options.
+    pub fn usage(&self, brief: &str) -> String {
+        self.usage_with_format(|opts|
+            format!("{}\n\nOptions:\n{}\n", brief, opts.collect::<Vec<String>>().join("\n")))
+    }
+
+    /// Derive a custom formatted message from a set of options. The formatted options provided to
+    /// a closure as an iterator.
+    pub fn usage_with_format<F: FnMut(&mut Iterator<Item=String>) -> String>(&self, mut formatter: F) -> String {
+        formatter(&mut self.usage_items())
+    }
+
+    /// Derive usage items from a set of options.
+    fn usage_items<'a>(&'a self) -> Box<Iterator<Item=String> + 'a> {
+        let desc_sep = format!("\n{}", repeat(" ").take(24).collect::<String>());
+
+        let any_short = self.grps.iter().any(|optref| {
+            optref.short_name.len() > 0
+        });
+
+        let rows = self.grps.iter().map(move |optref| {
+            let OptGroup{short_name,
+                         long_name,
+                         hint,
+                         desc,
+                         hasarg,
+                         ..} = (*optref).clone();
+
+            let mut row = "    ".to_string();
+
+            // short option
+            match short_name.len() {
+                0 => {
+                    if any_short {
+                        row.push_str("    ");
+                    }
+                }
+                1 => {
+                    row.push('-');
+                    row.push_str(&short_name);
+                    if long_name.len() > 0 {
+                        row.push_str(", ");
+                    } else {
+                        // Only a single space here, so that any
+                        // argument is printed in the correct spot.
+                        row.push(' ');
+                    }
+                }
+                _ => panic!("the short name should only be 1 ascii char long"),
+            }
+
+            // long option
+            match long_name.len() {
+                0 => {}
+                _ => {
+                    if self.long_only {
+                        row.push('-');
+                    } else {
+                        row.push_str("--");
+                    }
+                    row.push_str(&long_name);
+                    row.push(' ');
+                }
+            }
+
+            // arg
+            match hasarg {
+                No => {}
+                Yes => row.push_str(&hint),
+                Maybe => {
+                    row.push('[');
+                    row.push_str(&hint);
+                    row.push(']');
+                }
+            }
+
+            // FIXME: #5516 should be graphemes not codepoints
+            // here we just need to indent the start of the description
+            let rowlen = row.chars().count();
+            if rowlen < 24 {
+                for _ in 0 .. 24 - rowlen {
+                    row.push(' ');
+                }
+            } else {
+                row.push_str(&desc_sep)
+            }
+
+            // Normalize desc to contain words separated by one space character
+            let mut desc_normalized_whitespace = String::new();
+            for word in desc.split(|c: char| c.is_whitespace())
+                            .filter(|s| !s.is_empty()) {
+                desc_normalized_whitespace.push_str(word);
+                desc_normalized_whitespace.push(' ');
+            }
+
+            // FIXME: #5516 should be graphemes not codepoints
+            let mut desc_rows = Vec::new();
+            each_split_within(&desc_normalized_whitespace,
+                              54,
+                              |substr| {
+                desc_rows.push(substr.to_string());
+                true
+            });
+
+            // FIXME: #5516 should be graphemes not codepoints
+            // wrapped description
+            row.push_str(&desc_rows.join(&desc_sep));
+
+            row
+        });
+
+       Box::new(rows)
+    }
+}
+
+fn validate_names(short_name: &str, long_name: &str) {
+    let len = short_name.len();
+    assert!(len == 1 || len == 0,
+            "the short_name (first argument) should be a single character, \
+             or an empty string for none");
+    let len = long_name.len();
+    assert!(len == 0 || len > 1,
+            "the long_name (second argument) should be longer than a single \
+             character, or an empty string for none");
+}
+
+/// What parsing style to use when parsing arguments.
+#[derive(Clone, Copy, PartialEq, Eq)]
+pub enum ParsingStyle {
+    /// Flags and "free" arguments can be freely inter-mixed.
+    FloatingFrees,
+    /// As soon as a "free" argument (i.e. non-flag) is encountered, stop
+    /// considering any remaining arguments as flags.
+    StopAtFirstFree
+}
+
+/// Name of an option. Either a string or a single char.
+#[derive(Clone, PartialEq, Eq)]
+enum Name {
+    /// A string representing the long name of an option.
+    /// For example: "help"
+    Long(String),
+    /// A char representing the short name of an option.
+    /// For example: 'h'
+    Short(char),
+}
+
+/// Describes whether an option has an argument.
+#[derive(Clone, Copy, PartialEq, Eq)]
+pub enum HasArg {
+    /// The option requires an argument.
+    Yes,
+    /// The option takes no argument.
+    No,
+    /// The option argument is optional.
+    Maybe,
+}
+
+/// Describes how often an option may occur.
+#[derive(Clone, Copy, PartialEq, Eq)]
+pub enum Occur {
+    /// The option occurs once.
+    Req,
+    /// The option occurs at most once.
+    Optional,
+    /// The option occurs zero or more times.
+    Multi,
+}
+
+/// A description of a possible option.
+#[derive(Clone, PartialEq, Eq)]
+struct Opt {
+    /// Name of the option
+    name: Name,
+    /// Whether it has an argument
+    hasarg: HasArg,
+    /// How often it can occur
+    occur: Occur,
+    /// Which options it aliases
+    aliases: Vec<Opt>,
+}
+
+/// One group of options, e.g., both `-h` and `--help`, along with
+/// their shared description and properties.
+#[derive(Clone, PartialEq, Eq)]
+struct OptGroup {
+    /// Short name of the option, e.g. `h` for a `-h` option
+    short_name: String,
+    /// Long name of the option, e.g. `help` for a `--help` option
+    long_name: String,
+    /// Hint for argument, e.g. `FILE` for a `-o FILE` option
+    hint: String,
+    /// Description for usage help text
+    desc: String,
+    /// Whether option has an argument
+    hasarg: HasArg,
+    /// How often it can occur
+    occur: Occur
+}
+
+/// Describes whether an option is given at all or has a value.
+#[derive(Clone, PartialEq, Eq)]
+enum Optval {
+    Val(String),
+    Given,
+}
+
+/// The result of checking command line arguments. Contains a vector
+/// of matches and a vector of free strings.
+#[derive(Clone, PartialEq, Eq)]
+pub struct Matches {
+    /// Options that matched
+    opts: Vec<Opt>,
+    /// Values of the Options that matched
+    vals: Vec<Vec<Optval>>,
+    /// Free string fragments
+    pub free: Vec<String>,
+}
+
+/// The type returned when the command line does not conform to the
+/// expected format. Use the `Debug` implementation to output detailed
+/// information.
+#[derive(Clone, Debug, PartialEq, Eq)]
+pub enum Fail {
+    /// The option requires an argument but none was passed.
+    ArgumentMissing(String),
+    /// The passed option is not declared among the possible options.
+    UnrecognizedOption(String),
+    /// A required option is not present.
+    OptionMissing(String),
+    /// A single occurrence option is being used multiple times.
+    OptionDuplicated(String),
+    /// There's an argument being passed to a non-argument option.
+    UnexpectedArgument(String),
+}
+
+impl Error for Fail {
+    fn description(&self) -> &str {
+        match *self {
+            ArgumentMissing(_) => "missing argument",
+            UnrecognizedOption(_) => "unrecognized option",
+            OptionMissing(_) => "missing option",
+            OptionDuplicated(_) => "duplicated option",
+            UnexpectedArgument(_) => "unexpected argument",
+        }
+    }
+}
+
+/// The result of parsing a command line with a set of options.
+pub type Result = result::Result<Matches, Fail>;
+
+impl Name {
+    fn from_str(nm: &str) -> Name {
+        if nm.len() == 1 {
+            Short(nm.as_bytes()[0] as char)
+        } else {
+            Long(nm.to_string())
+        }
+    }
+
+    fn to_string(&self) -> String {
+        match *self {
+            Short(ch) => ch.to_string(),
+            Long(ref s) => s.to_string()
+        }
+    }
+}
+
+impl OptGroup {
+    /// Translate OptGroup into Opt.
+    /// (Both short and long names correspond to different Opts).
+    fn long_to_short(&self) -> Opt {
+        let OptGroup {
+            short_name,
+            long_name,
+            hasarg,
+            occur,
+            ..
+        } = (*self).clone();
+
+        match (short_name.len(), long_name.len()) {
+            (0,0) => panic!("this long-format option was given no name"),
+            (0,_) => Opt {
+                name: Long(long_name),
+                hasarg: hasarg,
+                occur: occur,
+                aliases: Vec::new()
+            },
+            (1,0) => Opt {
+                name: Short(short_name.as_bytes()[0] as char),
+                hasarg: hasarg,
+                occur: occur,
+                aliases: Vec::new()
+            },
+            (1,_) => Opt {
+                name: Long(long_name),
+                hasarg: hasarg,
+                occur: occur,
+                aliases: vec!(
+                    Opt {
+                        name: Short(short_name.as_bytes()[0] as char),
+                        hasarg: hasarg,
+                        occur:  occur,
+                        aliases: Vec::new()
+                    }
+                )
+            },
+            (_,_) => panic!("something is wrong with the long-form opt")
+        }
+    }
+}
+
+impl Matches {
+    fn opt_vals(&self, nm: &str) -> Vec<Optval> {
+        match find_opt(&self.opts, &Name::from_str(nm)) {
+            Some(id) => self.vals[id].clone(),
+            None => panic!("No option '{}' defined", nm)
+        }
+    }
+
+    fn opt_val(&self, nm: &str) -> Option<Optval> {
+        self.opt_vals(nm).into_iter().next()
+    }
+    /// Returns true if an option was defined
+    pub fn opt_defined(&self, nm: &str) -> bool {
+        find_opt(&self.opts, &Name::from_str(nm)).is_some()
+    }
+
+    /// Returns true if an option was matched.
+    pub fn opt_present(&self, nm: &str) -> bool {
+        !self.opt_vals(nm).is_empty()
+    }
+
+    /// Returns the number of times an option was matched.
+    pub fn opt_count(&self, nm: &str) -> usize {
+        self.opt_vals(nm).len()
+    }
+
+    /// Returns true if any of several options were matched.
+    pub fn opts_present(&self, names: &[String]) -> bool {
+        names.iter().any(|nm| {
+            match find_opt(&self.opts, &Name::from_str(&nm)) {
+                Some(id) if !self.vals[id].is_empty() => true,
+                _ => false,
+            }
+        })
+    }
+
+    /// Returns the string argument supplied to one of several matching options or `None`.
+    pub fn opts_str(&self, names: &[String]) -> Option<String> {
+        names.iter().filter_map(|nm| {
+            match self.opt_val(&nm) {
+                Some(Val(s)) => Some(s),
+                _ => None,
+            }
+        }).next()
+    }
+
+    /// Returns a vector of the arguments provided to all matches of the given
+    /// option.
+    ///
+    /// Used when an option accepts multiple values.
+    pub fn opt_strs(&self, nm: &str) -> Vec<String> {
+        self.opt_vals(nm).into_iter().filter_map(|v| {
+            match v {
+                Val(s) => Some(s),
+                _ => None,
+            }
+        }).collect()
+    }
+
+    /// Returns the string argument supplied to a matching option or `None`.
+    pub fn opt_str(&self, nm: &str) -> Option<String> {
+        match self.opt_val(nm) {
+            Some(Val(s)) => Some(s),
+            _ => None,
+        }
+    }
+
+
+    /// Returns the matching string, a default, or `None`.
+    ///
+    /// Returns `None` if the option was not present, `def` if the option was
+    /// present but no argument was provided, and the argument if the option was
+    /// present and an argument was provided.
+    pub fn opt_default(&self, nm: &str, def: &str) -> Option<String> {
+        match self.opt_val(nm) {
+            Some(Val(s)) => Some(s),
+            Some(_) => Some(def.to_string()),
+            None => None,
+        }
+    }
+
+}
+
+fn is_arg(arg: &str) -> bool {
+    arg.as_bytes().get(0) == Some(&b'-') && arg.len() > 1
+}
+
+fn find_opt(opts: &[Opt], nm: &Name) -> Option<usize> {
+    // Search main options.
+    let pos = opts.iter().position(|opt| &opt.name == nm);
+    if pos.is_some() {
+        return pos
+    }
+
+    // Search in aliases.
+    for candidate in opts.iter() {
+        if candidate.aliases.iter().position(|opt| &opt.name == nm).is_some() {
+            return opts.iter().position(|opt| opt.name == candidate.name);
+        }
+    }
+
+    None
+}
+
+impl fmt::Display for Fail {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match *self {
+            ArgumentMissing(ref nm) => {
+                write!(f, "Argument to option '{}' missing", *nm)
+            }
+            UnrecognizedOption(ref nm) => {
+                write!(f, "Unrecognized option: '{}'", *nm)
+            }
+            OptionMissing(ref nm) => {
+                write!(f, "Required option '{}' missing", *nm)
+            }
+            OptionDuplicated(ref nm) => {
+                write!(f, "Option '{}' given more than once", *nm)
+            }
+            UnexpectedArgument(ref nm) => {
+                write!(f, "Option '{}' does not take an argument", *nm)
+            }
+        }
+    }
+}
+
+fn format_option(opt: &OptGroup) -> String {
+    let mut line = String::new();
+
+    if opt.occur != Req {
+        line.push('[');
+    }
+
+    // Use short_name if possible, but fall back to long_name.
+    if opt.short_name.len() > 0 {
+        line.push('-');
+        line.push_str(&opt.short_name);
+    } else {
+        line.push_str("--");
+        line.push_str(&opt.long_name);
+    }
+
+    if opt.hasarg != No {
+        line.push(' ');
+        if opt.hasarg == Maybe {
+            line.push('[');
+        }
+        line.push_str(&opt.hint);
+        if opt.hasarg == Maybe {
+            line.push(']');
+        }
+    }
+
+    if opt.occur != Req {
+        line.push(']');
+    }
+    if opt.occur == Multi {
+        line.push_str("..");
+    }
+
+    line
+}
+
+#[derive(Clone, Copy)]
+enum SplitWithinState {
+    A,  // leading whitespace, initial state
+    B,  // words
+    C,  // internal and trailing whitespace
+}
+
+#[derive(Clone, Copy)]
+enum Whitespace {
+    Ws, // current char is whitespace
+    Cr  // current char is not whitespace
+}
+
+#[derive(Clone, Copy)]
+enum LengthLimit {
+    UnderLim, // current char makes current substring still fit in limit
+    OverLim   // current char makes current substring no longer fit in limit
+}
+
+
+/// Splits a string into substrings with possibly internal whitespace,
+/// each of them at most `lim` bytes long, if possible. The substrings
+/// have leading and trailing whitespace removed, and are only cut at
+/// whitespace boundaries.
+///
+/// Note: Function was moved here from `std::str` because this module is the only place that
+/// uses it, and because it was too specific for a general string function.
+fn each_split_within<'a, F>(ss: &'a str, lim: usize, mut it: F)
+                            -> bool where F: FnMut(&'a str) -> bool {
+    // Just for fun, let's write this as a state machine:
+
+    let mut slice_start = 0;
+    let mut last_start = 0;
+    let mut last_end = 0;
+    let mut state = A;
+    let mut fake_i = ss.len();
+    let mut lim = lim;
+
+    let mut cont = true;
+
+    // if the limit is larger than the string, lower it to save cycles
+    if lim >= fake_i {
+        lim = fake_i;
+    }
+
+    let mut machine = |cont: &mut bool, state: &mut SplitWithinState, (i, c): (usize, char)| {
+        let whitespace = if c.is_whitespace() { Ws }       else { Cr };
+        let limit      = if (i - slice_start + 1) <= lim  { UnderLim } else { OverLim };
+
+        *state = match (*state, whitespace, limit) {
+            (A, Ws, _)        => { A }
+            (A, Cr, _)        => { slice_start = i; last_start = i; B }
+
+            (B, Cr, UnderLim) => { B }
+            (B, Cr, OverLim)  if (i - last_start + 1) > lim => {
+                // A single word has gone over the limit.  In this
+                // case we just accept that the word will be too long.
+                B
+            }
+            (B, Cr, OverLim)  => {
+                *cont = it(&ss[slice_start..last_end]);
+                slice_start = last_start;
+                B
+            }
+            (B, Ws, UnderLim) => {
+                last_end = i;
+                C
+            }
+            (B, Ws, OverLim)  => {
+                last_end = i;
+                *cont = it(&ss[slice_start..last_end]);
+                A
+            }
+
+            (C, Cr, UnderLim) => {
+                last_start = i;
+                B
+            }
+            (C, Cr, OverLim)  => {
+                *cont = it(&ss[slice_start..last_end]);
+                slice_start = i;
+                last_start = i;
+                last_end = i;
+                B
+            }
+            (C, Ws, OverLim)  => {
+                *cont = it(&ss[slice_start..last_end]);
+                A
+            }
+            (C, Ws, UnderLim) => {
+                C
+            }
+        };
+
+        *cont
+    };
+
+    ss.char_indices().all(|x| machine(&mut cont, &mut state, x));
+
+    // Let the automaton 'run out' by supplying trailing whitespace
+    while cont && match state { B | C => true, A => false } {
+        machine(&mut cont, &mut state, (fake_i, ' '));
+        fake_i += 1;
+    }
+    return cont;
+}
+
+#[test]
+fn test_split_within() {
+    fn t(s: &str, i: usize, u: &[String]) {
+        let mut v = Vec::new();
+        each_split_within(s, i, |s| { v.push(s.to_string()); true });
+        assert!(v.iter().zip(u.iter()).all(|(a,b)| a == b));
+    }
+    t("", 0, &[]);
+    t("", 15, &[]);
+    t("hello", 15, &["hello".to_string()]);
+    t("\nMary had a little lamb\nLittle lamb\n", 15, &[
+        "Mary had a".to_string(),
+        "little lamb".to_string(),
+        "Little lamb".to_string()
+    ]);
+    t("\nMary had a little lamb\nLittle lamb\n", ::std::usize::MAX,
+        &["Mary had a little lamb\nLittle lamb".to_string()]);
+}
+
+#[cfg(test)]
+mod tests {
+    use super::{HasArg, Name, Occur, Opt, Options, ParsingStyle};
+    use super::Fail::*;
+
+    // Tests for reqopt
+    #[test]
+    fn test_reqopt() {
+        let long_args = vec!("--test=20".to_string());
+        let mut opts = Options::new();
+        opts.reqopt("t", "test", "testing", "TEST");
+        match opts.parse(&long_args) {
+          Ok(ref m) => {
+            assert!(m.opt_present("test"));
+            assert_eq!(m.opt_str("test").unwrap(), "20");
+            assert!(m.opt_present("t"));
+            assert_eq!(m.opt_str("t").unwrap(), "20");
+          }
+          _ => { panic!("test_reqopt failed (long arg)"); }
+        }
+        let short_args = vec!("-t".to_string(), "20".to_string());
+        match opts.parse(&short_args) {
+          Ok(ref m) => {
+            assert!((m.opt_present("test")));
+            assert_eq!(m.opt_str("test").unwrap(), "20");
+            assert!((m.opt_present("t")));
+            assert_eq!(m.opt_str("t").unwrap(), "20");
+          }
+          _ => { panic!("test_reqopt failed (short arg)"); }
+        }
+    }
+
+    #[test]
+    fn test_reqopt_missing() {
+        let args = vec!("blah".to_string());
+        match Options::new()
+                      .reqopt("t", "test", "testing", "TEST")
+                      .parse(&args) {
+          Err(OptionMissing(_)) => {},
+          _ => panic!()
+        }
+    }
+
+    #[test]
+    fn test_reqopt_no_arg() {
+        let long_args = vec!("--test".to_string());
+        let mut opts = Options::new();
+        opts.reqopt("t", "test", "testing", "TEST");
+        match opts.parse(&long_args) {
+          Err(ArgumentMissing(_)) => {},
+          _ => panic!()
+        }
+        let short_args = vec!("-t".to_string());
+        match opts.parse(&short_args) {
+          Err(ArgumentMissing(_)) => {},
+          _ => panic!()
+        }
+    }
+
+    #[test]
+    fn test_reqopt_multi() {
+        let args = vec!("--test=20".to_string(), "-t".to_string(), "30".to_string());
+        match Options::new()
+                      .reqopt("t", "test", "testing", "TEST")
+                      .parse(&args) {
+          Err(OptionDuplicated(_)) => {},
+          _ => panic!()
+        }
+    }
+
+    // Tests for optopt
+    #[test]
+    fn test_optopt() {
+        let long_args = vec!("--test=20".to_string());
+        let mut opts = Options::new();
+        opts.optopt("t", "test", "testing", "TEST");
+        match opts.parse(&long_args) {
+          Ok(ref m) => {
+            assert!(m.opt_present("test"));
+            assert_eq!(m.opt_str("test").unwrap(), "20");
+            assert!((m.opt_present("t")));
+            assert_eq!(m.opt_str("t").unwrap(), "20");
+          }
+          _ => panic!()
+        }
+        let short_args = vec!("-t".to_string(), "20".to_string());
+        match opts.parse(&short_args) {
+          Ok(ref m) => {
+            assert!((m.opt_present("test")));
+            assert_eq!(m.opt_str("test").unwrap(), "20");
+            assert!((m.opt_present("t")));
+            assert_eq!(m.opt_str("t").unwrap(), "20");
+          }
+          _ => panic!()
+        }
+    }
+
+    #[test]
+    fn test_optopt_missing() {
+        let args = vec!("blah".to_string());
+        match Options::new()
+                      .optopt("t", "test", "testing", "TEST")
+                      .parse(&args) {
+          Ok(ref m) => {
+            assert!(!m.opt_present("test"));
+            assert!(!m.opt_present("t"));
+          }
+          _ => panic!()
+        }
+    }
+
+    #[test]
+    fn test_optopt_no_arg() {
+        let long_args = vec!("--test".to_string());
+        let mut opts = Options::new();
+        opts.optopt("t", "test", "testing", "TEST");
+        match opts.parse(&long_args) {
+          Err(ArgumentMissing(_)) => {},
+          _ => panic!()
+        }
+        let short_args = vec!("-t".to_string());
+        match opts.parse(&short_args) {
+          Err(ArgumentMissing(_)) => {},
+          _ => panic!()
+        }
+    }
+
+    #[test]
+    fn test_optopt_multi() {
+        let args = vec!("--test=20".to_string(), "-t".to_string(), "30".to_string());
+        match Options::new()
+                      .optopt("t", "test", "testing", "TEST")
+                      .parse(&args) {
+          Err(OptionDuplicated(_)) => {},
+          _ => panic!()
+        }
+    }
+
+    // Tests for optflag
+    #[test]
+    fn test_optflag() {
+        let long_args = vec!("--test".to_string());
+        let mut opts = Options::new();
+        opts.optflag("t", "test", "testing");
+        match opts.parse(&long_args) {
+          Ok(ref m) => {
+            assert!(m.opt_present("test"));
+            assert!(m.opt_present("t"));
+          }
+          _ => panic!()
+        }
+        let short_args = vec!("-t".to_string());
+        match opts.parse(&short_args) {
+          Ok(ref m) => {
+            assert!(m.opt_present("test"));
+            assert!(m.opt_present("t"));
+          }
+          _ => panic!()
+        }
+    }
+
+    #[test]
+    fn test_optflag_missing() {
+        let args = vec!("blah".to_string());
+        match Options::new()
+                      .optflag("t", "test", "testing")
+                      .parse(&args) {
+          Ok(ref m) => {
+            assert!(!m.opt_present("test"));
+            assert!(!m.opt_present("t"));
+          }
+          _ => panic!()
+        }
+    }
+
+    #[test]
+    fn test_opt_end() {
+        let args = vec!["--".to_owned(), "-t".to_owned()];
+        match Options::new()
+                      .optflag("t", "test", "testing")
+                      .parse(&args) {
+          Ok(ref m) => {
+            assert!(!m.opt_present("test"));
+            assert!(!m.opt_present("t"));
+            assert_eq!(m.free.len(), 1);
+            assert_eq!(m.free[0], "-t");
+          }
+          _ => panic!()
+        }
+    }
+
+    #[test]
+    fn test_opt_only_end() {
+        let args = vec!["--".to_owned()];
+        match Options::new()
+                      .optflag("t", "test", "testing")
+                      .parse(&args) {
+          Ok(ref m) => {
+            assert!(!m.opt_present("test"));
+            assert!(!m.opt_present("t"));
+            assert_eq!(m.free.len(), 0);
+          }
+          _ => panic!()
+        }
+    }
+
+    #[test]
+    fn test_optflag_long_arg() {
+        let args = vec!("--test=20".to_string());
+        match Options::new()
+                      .optflag("t", "test", "testing")
+                      .parse(&args) {
+          Err(UnexpectedArgument(_)) => {},
+          _ => panic!()
+        }
+    }
+
+    #[test]
+    fn test_optflag_multi() {
+        let args = vec!("--test".to_string(), "-t".to_string());
+        match Options::new()
+                      .optflag("t", "test", "testing")
+                      .parse(&args) {
+          Err(OptionDuplicated(_)) => {},
+          _ => panic!()
+        }
+    }
+
+    #[test]
+    fn test_optflag_short_arg() {
+        let args = vec!("-t".to_string(), "20".to_string());
+        match Options::new()
+                      .optflag("t", "test", "testing")
+                      .parse(&args) {
+          Ok(ref m) => {
+            // The next variable after the flag is just a free argument
+
+            assert!(m.free[0] == "20");
+          }
+          _ => panic!()
+        }
+    }
+
+    // Tests for optflagmulti
+    #[test]
+    fn test_optflagmulti_short1() {
+        let args = vec!("-v".to_string());
+        match Options::new()
+                      .optflagmulti("v", "verbose", "verbosity")
+                      .parse(&args) {
+          Ok(ref m) => {
+            assert_eq!(m.opt_count("v"), 1);
+          }
+          _ => panic!()
+        }
+    }
+
+    #[test]
+    fn test_optflagmulti_short2a() {
+        let args = vec!("-v".to_string(), "-v".to_string());
+        match Options::new()
+                      .optflagmulti("v", "verbose", "verbosity")
+                      .parse(&args) {
+          Ok(ref m) => {
+            assert_eq!(m.opt_count("v"), 2);
+          }
+          _ => panic!()
+        }
+    }
+
+    #[test]
+    fn test_optflagmulti_short2b() {
+        let args = vec!("-vv".to_string());
+        match Options::new()
+                      .optflagmulti("v", "verbose", "verbosity")
+                      .parse(&args) {
+          Ok(ref m) => {
+            assert_eq!(m.opt_count("v"), 2);
+          }
+          _ => panic!()
+        }
+    }
+
+    #[test]
+    fn test_optflagmulti_long1() {
+        let args = vec!("--verbose".to_string());
+        match Options::new()
+                      .optflagmulti("v", "verbose", "verbosity")
+                      .parse(&args) {
+          Ok(ref m) => {
+            assert_eq!(m.opt_count("verbose"), 1);
+          }
+          _ => panic!()
+        }
+    }
+
+    #[test]
+    fn test_optflagmulti_long2() {
+        let args = vec!("--verbose".to_string(), "--verbose".to_string());
+        match Options::new()
+                      .optflagmulti("v", "verbose", "verbosity")
+                      .parse(&args) {
+          Ok(ref m) => {
+            assert_eq!(m.opt_count("verbose"), 2);
+          }
+          _ => panic!()
+        }
+    }
+
+    #[test]
+    fn test_optflagmulti_mix() {
+        let args = vec!("--verbose".to_string(), "-v".to_string(),
+                        "-vv".to_string(), "verbose".to_string());
+        match Options::new()
+                      .optflagmulti("v", "verbose", "verbosity")
+                      .parse(&args) {
+          Ok(ref m) => {
+            assert_eq!(m.opt_count("verbose"), 4);
+            assert_eq!(m.opt_count("v"), 4);
+          }
+          _ => panic!()
+        }
+    }
+
+    // Tests for optflagopt
+    #[test]
+    fn test_optflagopt() {
+        let long_args = vec!("--test".to_string());
+        let mut opts = Options::new();
+        opts.optflagopt("t", "test", "testing", "ARG");
+        match opts.parse(&long_args) {
+          Ok(ref m) => {
+            assert!(m.opt_present("test"));
+            assert!(m.opt_present("t"));
+          }
+          _ => panic!()
+        }
+        let short_args = vec!("-t".to_string());
+        match opts.parse(&short_args) {
+          Ok(ref m) => {
+            assert!(m.opt_present("test"));
+            assert!(m.opt_present("t"));
+          }
+          _ => panic!()
+        }
+        let short_args = vec!("-t".to_string(), "x".to_string());
+        match opts.parse(&short_args) {
+            Ok(ref m) => {
+                assert_eq!(m.opt_str("t").unwrap(), "x");
+                assert_eq!(m.opt_str("test").unwrap(), "x");
+            }
+            _ => panic!()
+        }
+        let long_args = vec!("--test=x".to_string());
+        match opts.parse(&long_args) {
+            Ok(ref m) => {
+                assert_eq!(m.opt_str("t").unwrap(), "x");
+                assert_eq!(m.opt_str("test").unwrap(), "x");
+            }
+            _ => panic!()
+        }
+        let long_args = vec!("--test".to_string(), "x".to_string());
+        match opts.parse(&long_args) {
+            Ok(ref m) => {
+                assert_eq!(m.opt_str("t"), None);
+                assert_eq!(m.opt_str("test"), None);
+            }
+            _ => panic!()
+        }
+        let no_args: Vec<String> = vec!();
+        match opts.parse(&no_args) {
+          Ok(ref m) => {
+            assert!(!m.opt_present("test"));
+            assert!(!m.opt_present("t"));
+          }
+          _ => panic!()
+        }
+    }
+
+    // Tests for optmulti
+    #[test]
+    fn test_optmulti() {
+        let long_args = vec!("--test=20".to_string());
+        let mut opts = Options::new();
+        opts.optmulti("t", "test", "testing", "TEST");
+        match opts.parse(&long_args) {
+          Ok(ref m) => {
+            assert!((m.opt_present("test")));
+            assert_eq!(m.opt_str("test").unwrap(), "20");
+            assert!((m.opt_present("t")));
+            assert_eq!(m.opt_str("t").unwrap(), "20");
+          }
+          _ => panic!()
+        }
+        let short_args = vec!("-t".to_string(), "20".to_string());
+        match opts.parse(&short_args) {
+          Ok(ref m) => {
+            assert!((m.opt_present("test")));
+            assert_eq!(m.opt_str("test").unwrap(), "20");
+            assert!((m.opt_present("t")));
+            assert_eq!(m.opt_str("t").unwrap(), "20");
+          }
+          _ => panic!()
+        }
+    }
+
+    #[test]
+    fn test_optmulti_missing() {
+        let args = vec!("blah".to_string());
+        match Options::new()
+                      .optmulti("t", "test", "testing", "TEST")
+                      .parse(&args) {
+          Ok(ref m) => {
+            assert!(!m.opt_present("test"));
+            assert!(!m.opt_present("t"));
+          }
+          _ => panic!()
+        }
+    }
+
+    #[test]
+    fn test_optmulti_no_arg() {
+        let long_args = vec!("--test".to_string());
+        let mut opts = Options::new();
+        opts.optmulti("t", "test", "testing", "TEST");
+        match opts.parse(&long_args) {
+          Err(ArgumentMissing(_)) => {},
+          _ => panic!()
+        }
+        let short_args = vec!("-t".to_string());
+        match opts.parse(&short_args) {
+          Err(ArgumentMissing(_)) => {},
+          _ => panic!()
+        }
+    }
+
+    #[test]
+    fn test_optmulti_multi() {
+        let args = vec!("--test=20".to_string(), "-t".to_string(), "30".to_string());
+        match Options::new()
+                      .optmulti("t", "test", "testing", "TEST")
+                      .parse(&args) {
+          Ok(ref m) => {
+              assert!(m.opt_present("test"));
+              assert_eq!(m.opt_str("test").unwrap(), "20");
+              assert!(m.opt_present("t"));
+              assert_eq!(m.opt_str("t").unwrap(), "20");
+              let pair = m.opt_strs("test");
+              assert!(pair[0] == "20");
+              assert!(pair[1] == "30");
+          }
+          _ => panic!()
+        }
+    }
+
+    #[test]
+    fn test_free_argument_is_hyphen() {
+        let args = vec!("-".to_string());
+        match Options::new().parse(&args) {
+            Ok(ref m) => {
+                assert_eq!(m.free.len(), 1);
+                assert_eq!(m.free[0], "-");
+            }
+            _ => panic!()
+        }
+    }
+
+    #[test]
+    fn test_unrecognized_option() {
+        let long_args = vec!("--untest".to_string());
+        let mut opts = Options::new();
+        opts.optmulti("t", "test", "testing", "TEST");
+        match opts.parse(&long_args) {
+          Err(UnrecognizedOption(_)) => {},
+          _ => panic!()
+        }
+        let short_args = vec!("-u".to_string());
+        match opts.parse(&short_args) {
+          Err(UnrecognizedOption(_)) => {},
+          _ => panic!()
+        }
+    }
+
+    #[test]
+    fn test_combined() {
+        let args =
+            vec!("prog".to_string(),
+                 "free1".to_string(),
+                 "-s".to_string(),
+                 "20".to_string(),
+                 "free2".to_string(),
+                 "--flag".to_string(),
+                 "--long=30".to_string(),
+                 "-f".to_string(),
+                 "-m".to_string(),
+                 "40".to_string(),
+                 "-m".to_string(),
+                 "50".to_string(),
+                 "-n".to_string(),
+                 "-A B".to_string(),
+                 "-n".to_string(),
+                 "-60 70".to_string());
+        match Options::new()
+                      .optopt("s", "something", "something", "SOMETHING")
+                      .optflag("", "flag", "a flag")
+                      .reqopt("", "long", "hi", "LONG")
+                      .optflag("f", "", "another flag")
+                      .optmulti("m", "", "mmmmmm", "YUM")
+                      .optmulti("n", "", "nothing", "NOTHING")
+                      .optopt("", "notpresent", "nothing to see here", "NOPE")
+                      .parse(&args) {
+          Ok(ref m) => {
+            assert!(m.free[0] == "prog");
+            assert!(m.free[1] == "free1");
+            assert_eq!(m.opt_str("s").unwrap(), "20");
+            assert!(m.free[2] == "free2");
+            assert!((m.opt_present("flag")));
+            assert_eq!(m.opt_str("long").unwrap(), "30");
+            assert!((m.opt_present("f")));
+            let pair = m.opt_strs("m");
+            assert!(pair[0] == "40");
+            assert!(pair[1] == "50");
+            let pair = m.opt_strs("n");
+            assert!(pair[0] == "-A B");
+            assert!(pair[1] == "-60 70");
+            assert!((!m.opt_present("notpresent")));
+          }
+          _ => panic!()
+        }
+    }
+
+    #[test]
+    fn test_mixed_stop() {
+        let args =
+            vec!("-a".to_string(),
+                 "b".to_string(),
+                 "-c".to_string(),
+                 "d".to_string());
+        match Options::new()
+              .parsing_style(ParsingStyle::StopAtFirstFree)
+              .optflag("a", "", "")
+              .optopt("c", "", "", "")
+              .parse(&args) {
+          Ok(ref m) => {
+            println!("{}", m.opt_present("c"));
+            assert!(m.opt_present("a"));
+            assert!(!m.opt_present("c"));
+            assert_eq!(m.free.len(), 3);
+            assert_eq!(m.free[0], "b");
+            assert_eq!(m.free[1], "-c");
+            assert_eq!(m.free[2], "d");
+          }
+          _ => panic!()
+        }
+    }
+
+    #[test]
+    fn test_mixed_stop_hyphen() {
+        let args =
+            vec!("-a".to_string(),
+                 "-".to_string(),
+                 "-c".to_string(),
+                 "d".to_string());
+        match Options::new()
+              .parsing_style(ParsingStyle::StopAtFirstFree)
+              .optflag("a", "", "")
+              .optopt("c", "", "", "")
+              .parse(&args) {
+          Ok(ref m) => {
+            println!("{}", m.opt_present("c"));
+            assert!(m.opt_present("a"));
+            assert!(!m.opt_present("c"));
+            assert_eq!(m.free.len(), 3);
+            assert_eq!(m.free[0], "-");
+            assert_eq!(m.free[1], "-c");
+            assert_eq!(m.free[2], "d");
+          }
+          _ => panic!()
+        }
+    }
+
+    #[test]
+    fn test_multi() {
+        let mut opts = Options::new();
+        opts.optopt("e", "", "encrypt", "ENCRYPT");
+        opts.optopt("", "encrypt", "encrypt", "ENCRYPT");
+        opts.optopt("f", "", "flag", "FLAG");
+
+        let args_single = vec!("-e".to_string(), "foo".to_string());
+        let matches_single = &match opts.parse(&args_single) {
+          Ok(m) => m,
+          Err(_) => panic!()
+        };
+        assert!(matches_single.opts_present(&["e".to_string()]));
+        assert!(matches_single.opts_present(&["encrypt".to_string(), "e".to_string()]));
+        assert!(matches_single.opts_present(&["e".to_string(), "encrypt".to_string()]));
+        assert!(!matches_single.opts_present(&["encrypt".to_string()]));
+        assert!(!matches_single.opts_present(&["thing".to_string()]));
+        assert!(!matches_single.opts_present(&[]));
+
+        assert_eq!(matches_single.opts_str(&["e".to_string()]).unwrap(), "foo");
+        assert_eq!(matches_single.opts_str(&["e".to_string(), "encrypt".to_string()]).unwrap(),
+                   "foo");
+        assert_eq!(matches_single.opts_str(&["encrypt".to_string(), "e".to_string()]).unwrap(),
+                   "foo");
+
+        let args_both = vec!("-e".to_string(), "foo".to_string(), "--encrypt".to_string(),
+                             "foo".to_string());
+        let matches_both = &match opts.parse(&args_both) {
+          Ok(m) => m,
+          Err(_) => panic!()
+        };
+        assert!(matches_both.opts_present(&["e".to_string()]));
+        assert!(matches_both.opts_present(&["encrypt".to_string()]));
+        assert!(matches_both.opts_present(&["encrypt".to_string(), "e".to_string()]));
+        assert!(matches_both.opts_present(&["e".to_string(), "encrypt".to_string()]));
+        assert!(!matches_both.opts_present(&["f".to_string()]));
+        assert!(!matches_both.opts_present(&["thing".to_string()]));
+        assert!(!matches_both.opts_present(&[]));
+
+        assert_eq!(matches_both.opts_str(&["e".to_string()]).unwrap(), "foo");
+        assert_eq!(matches_both.opts_str(&["encrypt".to_string()]).unwrap(), "foo");
+        assert_eq!(matches_both.opts_str(&["e".to_string(), "encrypt".to_string()]).unwrap(),
+                   "foo");
+        assert_eq!(matches_both.opts_str(&["encrypt".to_string(), "e".to_string()]).unwrap(),
+                   "foo");
+    }
+
+    #[test]
+    fn test_nospace() {
+        let args = vec!("-Lfoo".to_string(), "-M.".to_string());
+        let matches = &match Options::new()
+                                     .optmulti("L", "", "library directory", "LIB")
+                                     .optmulti("M", "", "something", "MMMM")
+                                     .parse(&args) {
+          Ok(m) => m,
+          Err(_) => panic!()
+        };
+        assert!(matches.opts_present(&["L".to_string()]));
+        assert_eq!(matches.opts_str(&["L".to_string()]).unwrap(), "foo");
+        assert!(matches.opts_present(&["M".to_string()]));
+        assert_eq!(matches.opts_str(&["M".to_string()]).unwrap(), ".");
+
+    }
+
+    #[test]
+    fn test_nospace_conflict() {
+        let args = vec!("-vvLverbose".to_string(), "-v".to_string() );
+        let matches = &match Options::new()
+                                     .optmulti("L", "", "library directory", "LIB")
+                                     .optflagmulti("v", "verbose", "Verbose")
+                                     .parse(&args) {
+          Ok(m) => m,
+          Err(e) => panic!( "{}", e )
+        };
+        assert!(matches.opts_present(&["L".to_string()]));
+        assert_eq!(matches.opts_str(&["L".to_string()]).unwrap(), "verbose");
+        assert!(matches.opts_present(&["v".to_string()]));
+        assert_eq!(3, matches.opt_count("v"));
+    }
+
+    #[test]
+    fn test_long_to_short() {
+        let mut short = Opt {
+            name: Name::Long("banana".to_string()),
+            hasarg: HasArg::Yes,
+            occur: Occur::Req,
+            aliases: Vec::new(),
+        };
+        short.aliases = vec!(Opt { name: Name::Short('b'),
+                                hasarg: HasArg::Yes,
+                                occur: Occur::Req,
+                                aliases: Vec::new() });
+        let mut opts = Options::new();
+        opts.reqopt("b", "banana", "some bananas", "VAL");
+        let ref verbose = opts.grps[0];
+        assert!(verbose.long_to_short() == short);
+    }
+
+    #[test]
+    fn test_aliases_long_and_short() {
+        let args = vec!("-a".to_string(), "--apple".to_string(), "-a".to_string());
+
+        let matches = Options::new()
+                              .optflagmulti("a", "apple", "Desc")
+                              .parse(&args)
+                              .unwrap();
+        assert_eq!(3, matches.opt_count("a"));
+        assert_eq!(3, matches.opt_count("apple"));
+    }
+
+    #[test]
+    fn test_usage() {
+        let mut opts = Options::new();
+        opts.reqopt("b", "banana", "Desc", "VAL");
+        opts.optopt("a", "012345678901234567890123456789",
+                             "Desc", "VAL");
+        opts.optflag("k", "kiwi", "Desc");
+        opts.optflagopt("p", "", "Desc", "VAL");
+        opts.optmulti("l", "", "Desc", "VAL");
+        opts.optflag("", "starfruit", "Starfruit");
+
+        let expected =
+"Usage: fruits
+
+Options:
+    -b, --banana VAL    Desc
+    -a, --012345678901234567890123456789 VAL
+                        Desc
+    -k, --kiwi          Desc
+    -p [VAL]            Desc
+    -l VAL              Desc
+        --starfruit     Starfruit
+";
+
+        let generated_usage = opts.usage("Usage: fruits");
+
+        debug!("expected: <<{}>>", expected);
+        debug!("generated: <<{}>>", generated_usage);
+        assert_eq!(generated_usage, expected);
+    }
+
+    #[test]
+    fn test_usage_description_wrapping() {
+        // indentation should be 24 spaces
+        // lines wrap after 78: or rather descriptions wrap after 54
+
+        let mut opts = Options::new();
+        opts.optflag("k", "kiwi",
+            "This is a long description which won't be wrapped..+.."); // 54
+        opts.optflag("a", "apple",
+            "This is a long description which _will_ be wrapped..+..");
+        opts.optflag("b", "banana",
+            "HereWeNeedOneSingleWordThatIsLongerThanTheWrappingLengthAndThisIsIt");
+
+        let expected =
+"Usage: fruits
+
+Options:
+    -k, --kiwi          This is a long description which won't be wrapped..+..
+    -a, --apple         This is a long description which _will_ be
+                        wrapped..+..
+    -b, --banana        HereWeNeedOneSingleWordThatIsLongerThanTheWrappingLengthAndThisIsIt
+";
+
+        let usage = opts.usage("Usage: fruits");
+
+        debug!("expected: <<{}>>", expected);
+        debug!("generated: <<{}>>", usage);
+        assert!(usage == expected)
+    }
+
+    #[test]
+    fn test_usage_description_multibyte_handling() {
+        let mut opts = Options::new();
+        opts.optflag("k", "k\u{2013}w\u{2013}",
+            "The word kiwi is normally spelled with two i's");
+        opts.optflag("a", "apple",
+            "This \u{201C}description\u{201D} has some characters that could \
+confuse the line wrapping; an apple costs 0.51€ in some parts of Europe.");
+
+        let expected =
+"Usage: fruits
+
+Options:
+    -k, --k–w–          The word kiwi is normally spelled with two i's
+    -a, --apple         This “description” has some characters that could
+                        confuse the line wrapping; an apple costs 0.51€ in
+                        some parts of Europe.
+";
+
+        let usage = opts.usage("Usage: fruits");
+
+        debug!("expected: <<{}>>", expected);
+        debug!("generated: <<{}>>", usage);
+        assert!(usage == expected)
+    }
+
+    #[test]
+    fn test_usage_short_only() {
+        let mut opts = Options::new();
+        opts.optopt("k", "", "Kiwi", "VAL");
+        opts.optflag("s", "", "Starfruit");
+        opts.optflagopt("a", "", "Apple", "TYPE");
+
+        let expected =
+"Usage: fruits
+
+Options:
+    -k VAL              Kiwi
+    -s                  Starfruit
+    -a [TYPE]           Apple
+";
+
+        let usage = opts.usage("Usage: fruits");
+        debug!("expected: <<{}>>", expected);
+        debug!("generated: <<{}>>", usage);
+        assert!(usage == expected)
+    }
+
+    #[test]
+    fn test_usage_long_only() {
+        let mut opts = Options::new();
+        opts.optopt("", "kiwi", "Kiwi", "VAL");
+        opts.optflag("", "starfruit", "Starfruit");
+        opts.optflagopt("", "apple", "Apple", "TYPE");
+
+        let expected =
+"Usage: fruits
+
+Options:
+    --kiwi VAL          Kiwi
+    --starfruit         Starfruit
+    --apple [TYPE]      Apple
+";
+
+        let usage = opts.usage("Usage: fruits");
+        debug!("expected: <<{}>>", expected);
+        debug!("generated: <<{}>>", usage);
+        assert!(usage == expected)
+    }
+
+    #[test]
+    fn test_short_usage() {
+        let mut opts = Options::new();
+        opts.reqopt("b", "banana", "Desc", "VAL");
+        opts.optopt("a", "012345678901234567890123456789",
+                     "Desc", "VAL");
+        opts.optflag("k", "kiwi", "Desc");
+        opts.optflagopt("p", "", "Desc", "VAL");
+        opts.optmulti("l", "", "Desc", "VAL");
+
+        let expected = "Usage: fruits -b VAL [-a VAL] [-k] [-p [VAL]] [-l VAL]..".to_string();
+        let generated_usage = opts.short_usage("fruits");
+
+        debug!("expected: <<{}>>", expected);
+        debug!("generated: <<{}>>", generated_usage);
+        assert_eq!(generated_usage, expected);
+    }
+    #[test]
+    fn test_nonexistant_opt() {
+        let mut opts = Options::new();
+        opts.optflag("b", "bar", "Desc");
+        let args: Vec<String> = Vec::new();
+        let matches = opts.parse(&args).unwrap();
+        assert_eq!(matches.opt_defined("foo"), false);
+        assert_eq!(matches.opt_defined("bar"), true);
+    }
+    #[test]
+    fn test_args_with_equals() {
+        let mut opts = Options::new();
+        opts.optopt("o", "one", "One", "INFO");
+        opts.optopt("t", "two", "Two", "INFO");
+
+        let args = vec!("--one".to_string(), "A=B".to_string(),
+                        "--two=C=D".to_string());
+        let matches = &match opts.parse(&args) {
+            Ok(m) => m,
+            Err(e) => panic!("{}", e)
+        };
+        assert_eq!(matches.opts_str(&["o".to_string()]).unwrap(), "A=B");
+        assert_eq!(matches.opts_str(&["t".to_string()]).unwrap(), "C=D");
+    }
+
+    #[test]
+    fn test_long_only_usage() {
+        let mut opts = Options::new();
+        opts.long_only(true);
+        opts.optflag("k", "kiwi", "Description");
+        opts.optflag("a", "apple", "Description");
+
+        let expected =
+"Usage: fruits
+
+Options:
+    -k, -kiwi           Description
+    -a, -apple          Description
+";
+
+        let usage = opts.usage("Usage: fruits");
+
+        debug!("expected: <<{}>>", expected);
+        debug!("generated: <<{}>>", usage);
+        assert!(usage == expected)
+    }
+
+    #[test]
+    fn test_long_only_mode() {
+        let mut opts = Options::new();
+        opts.long_only(true);
+        opts.optopt("a", "apple", "Description", "X");
+        opts.optopt("b", "banana", "Description", "X");
+        opts.optopt("c", "currant", "Description", "X");
+        opts.optopt("", "durian", "Description", "X");
+        opts.optopt("e", "", "Description", "X");
+        opts.optopt("", "fruit", "Description", "X");
+
+        let args = vec!("-a", "A", "-b=B", "--c=C", "-durian", "D", "--e", "E",
+                        "-fruit=any");
+        let matches = &match opts.parse(&args) {
+            Ok(m) => m,
+            Err(e) => panic!("{}", e)
+        };
+        assert_eq!(matches.opts_str(&["a".to_string()]).unwrap(), "A");
+        assert_eq!(matches.opts_str(&["b".to_string()]).unwrap(), "B");
+        assert_eq!(matches.opts_str(&["c".to_string()]).unwrap(), "C");
+        assert_eq!(matches.opts_str(&["durian".to_string()]).unwrap(), "D");
+        assert_eq!(matches.opts_str(&["e".to_string()]).unwrap(), "E");
+        assert_eq!(matches.opts_str(&["fruit".to_string()]).unwrap(), "any");
+    }
+
+    #[test]
+    fn test_long_only_mode_no_short_parse() {
+        let mut opts = Options::new();
+        opts.long_only(true);
+        opts.optflag("h", "help", "Description");
+        opts.optflag("i", "ignore", "Description");
+        opts.optflag("", "hi", "Description");
+
+        let args = vec!("-hi");
+        let matches = &match opts.parse(&args) {
+            Ok(m) => m,
+            Err(e) => panic!("{}", e)
+        };
+        assert!(matches.opt_present("hi"));
+        assert!(!matches.opt_present("h"));
+        assert!(!matches.opt_present("i"));
+    }
+
+    #[test]
+    fn test_normal_mode_no_long_parse() {
+        // Like test_long_only_mode_no_short_parse, but we make sure
+        // that long_only can be disabled, and the right thing
+        // happens.
+        let mut opts = Options::new();
+        opts.long_only(true);
+        opts.optflag("h", "help", "Description");
+        opts.optflag("i", "ignore", "Description");
+        opts.optflag("", "hi", "Description");
+        opts.long_only(false);
+
+        let args = vec!("-hi");
+        let matches = &match opts.parse(&args) {
+            Ok(m) => m,
+            Err(e) => panic!("{}", e)
+        };
+        assert!(!matches.opt_present("hi"));
+        assert!(matches.opt_present("h"));
+        assert!(matches.opt_present("i"));
+    }
+
+    #[test]
+    #[should_panic]
+    fn test_long_name_too_short() {
+        let mut opts = Options::new();
+        opts.optflag("", "a", "Oops, long option too short");
+    }
+}
diff --git a/vendor/getopts/tests/smoke.rs b/vendor/getopts/tests/smoke.rs
new file mode 100644
index 0000000..a46f9c0
--- /dev/null
+++ b/vendor/getopts/tests/smoke.rs
@@ -0,0 +1,8 @@
+extern crate getopts;
+
+use std::env;
+
+#[test]
+fn main() {
+    getopts::Options::new().parse(env::args()).unwrap();
+}
diff --git a/vendor/pulse/.cargo-checksum.json b/vendor/pulse/.cargo-checksum.json
deleted file mode 100644
index a710c60..0000000
--- a/vendor/pulse/.cargo-checksum.json
+++ /dev/null
@@ -1 +0,0 @@
-{"files":{".images/and_gate.png":"20d8e63f70325d8db21a08ddfa8881a9633325e5056c76c022dd219c4cd9826b",".images/or_gate.png":"f800cd287f2b9bf87f2cc353a31e328fec3848d42f30811817aeb211a15b3562",".images/states.png":"a00690dc89146f233c7687213ef13415d463b2d9810fb1daadb1783687d12611",".travis.yml":"7dce69e5e2961c552d41932cf1ae73dee338c878474bf7526cc5d3f788b2b5a9","Cargo.toml":"5dd4005eef56091eeb226c7bc158a962755c3481d48e65a379620402d50f6053","LICENSE":"09e8a9bcec8067104652c168685ab0931e7868f9c8284b66f5ae6edae5f1130b","Readme.md":"b6b1370016c06c14a0b151e777b88068a39bb893997f628aae3538902bc48296","benches/benches.rs":"8fcb8c5c08b7d1debab8fddbe7a8574cbd01c84678babc24515e468ed32bb79f","src/barrier.rs":"55e4d4d73008508ee3ae3f9f4ae474aafe5b5a41aa829f99ad24076700fea791","src/fnbox.rs":"ee9131728c6fc302f303f9ad287e220d128a91526cc02016ec18dffaf75e2fbe","src/lib.rs":"218583b5af8122a28220131e8c6810028739aabd7a10eecfe0bf02e60ad174a5","src/lib.rs.bk":"a55602801d576a4e1ee5b27a5be5d66dc6d93a5b9446884062dafe5e3e7c7957","src/select.rs":"02eff926953843540e2998af6343c2f2943bce98613525a807f2f2b5f328ab89","tests/barrier.rs":"d735e1fe50329b22d62ed094ae820263f2c006526d4b64f8194ebdbde06d2c16","tests/select.rs":"018c84a95e8f9d01bfa8576ac77eab1fa9205dcebce06a5c0ecf37c2af8d7480","tests/simple.rs":"89ffb7cf82fab544efcf6c8a41891832445f5dccbd7a8ec5ef80eee0bcfe6ce6"},"package":"655612b6c8d96a8a02f331fe296cb4f925b68e87c1d195544675abca2d9b9af0"}
\ No newline at end of file
diff --git a/vendor/pulse/.images/and_gate.png b/vendor/pulse/.images/and_gate.png
deleted file mode 100644
index ae5c543..0000000
--- a/vendor/pulse/.images/and_gate.png
+++ /dev/null
Binary files differ
diff --git a/vendor/pulse/.images/or_gate.png b/vendor/pulse/.images/or_gate.png
deleted file mode 100644
index bc5e26e..0000000
--- a/vendor/pulse/.images/or_gate.png
+++ /dev/null
Binary files differ
diff --git a/vendor/pulse/.images/states.png b/vendor/pulse/.images/states.png
deleted file mode 100644
index 27a991f..0000000
--- a/vendor/pulse/.images/states.png
+++ /dev/null
Binary files differ
diff --git a/vendor/pulse/.travis.yml b/vendor/pulse/.travis.yml
deleted file mode 100644
index b0c32d2..0000000
--- a/vendor/pulse/.travis.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-language: rust
-
-env:
-  global:
-    - secure: yVllzM6AyHalvF0OuoG9mC5jI4AglwVl8B4iDdJNAoWKp0T3saV55PiW9lR0jd8VI9f9+0ciIP0bFmjMCm9F/NTK/75qtZd2mX41ONVUHAEYDRqRQo279HF7yXySnbTXXQjXD8seWCNxUsyIUU2XjJRKsCeh+WtivbqYmQzwg90=
-
-script:
-  - cargo build
-  - cargo test
-  - cargo doc
-
-after_script:
-  - mv target/doc doc
-  - curl http://www.rust-ci.org/artifacts/put?t=$RUSTCI_TOKEN | sh
-
-
-
diff --git a/vendor/pulse/Cargo.toml b/vendor/pulse/Cargo.toml
deleted file mode 100644
index 70b1e92..0000000
--- a/vendor/pulse/Cargo.toml
+++ /dev/null
@@ -1,15 +0,0 @@
-[package]
-name = "pulse"
-version = "0.5.3"
-authors = ["Colin Sherratt <colin.sherratt@gmail.com>"]
-license = "Apache-2.0"
-description = "A library for async wake signals"
-homepage = "https://github.com/csherratt/pulse"
-
-[dependencies]
-atom = "0.3"
-time = "0.1"
-
-[features]
-default = []
-callback = []
diff --git a/vendor/pulse/LICENSE b/vendor/pulse/LICENSE
deleted file mode 100644
index 67db858..0000000
--- a/vendor/pulse/LICENSE
+++ /dev/null
@@ -1,175 +0,0 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
diff --git a/vendor/pulse/Readme.md b/vendor/pulse/Readme.md
deleted file mode 100644
index dc879e7..0000000
--- a/vendor/pulse/Readme.md
+++ /dev/null
@@ -1,107 +0,0 @@
-Pulse
-=====
-[![Build Status](https://travis-ci.org/slide-rs/pulse.svg?branch=master)](https://travis-ci.org/slide-rs/pulse)
-[![Pulse](http://meritbadge.herokuapp.com/pulse)](https://crates.io/crates/pulse)
-
-Imagine you are building a fancy high performance channel for sending data between two threads. At some point, your are going to need to figure out a way to wait on the queue for new data to become available. Spinning on a `try_recv` sucks, and some people like their phones to have more than 30 minutes of battery. We need to implement `recv`.
-
-There are a few ways to do this, you could use a condition variable + mutex. So you lock your channel, check to see if there is data, then wait on the condition variable if there is nothing to read. If you wanted to do this without locking, you could use a Semaphore. Just do a `acquire()` on the semaphore, and if it ever returns you know there is data waiting to be read. As a bonus, it lets multiple threads wait on the same channel. Which is neat.
-
-So you are all happy, your benchmarks are good. Then someone, posts a issue asking if there is a way to wait on two channels. Hmm, this is not a trivial problem. A semaphore does not offer an api that would let you `acquire()` on more than one Semaphore at a time. Condition variables don’t either :(
-
-Pulse to the rescue! Pulse’s solution to the problem is a one-shot Signal. A Signal represents whether something has occurred or not. It has an extremely simple state transition diagram. It can only be Pending, Ready, or in an Dropped, and there is no way to unset a signal as it state is sticky.
-
-![state](https://raw.githubusercontent.com/csherratt/pulse/master/.images/states.png)
-
-It looks like this in practice:
-
-```rust
-// Create a new signal and pulse, the pulse is the setting side of a signal
-let (signal, pulse) = Signal::new();
-
-thread::spawn(move || {
-    // Do awesome things here, like uploading a cat picture to internet
-
-    // Trigger a pulse now that we are done
-    pulse.pulse();
-});
-
-// Wait for the pulse! :D
-signal.wait().unwrap();
-```
-
-You must be asking now, "Ok, but how does this help me with multiple channels? You got some sort of silly flag variable that you can wait on. So now instead of waiting on a Semaphore, I am waiting on your stupid Signal."
-
-Well, You can also Select over multiple signals:
-
-```rust
-let mut select = SelectMap::new();
-let (signal, pulse) = Signal::new();
-let join = thread::spawn(move || {
-    // Do something slow
-    pulse.pulse();
-});
-select.add(signal, join);
-
-let (signal, pulse) = Signal::new();
-let join = thread::spawn(move || {
-    // Do something else slow
-    pulse.pulse();
-});
-select.add(signal, join);
-
-for (_, join) in select {
-    join.join(); // \o/
-}
-```
-
-You ain't seen nothing yet. `Select` and `SelectMap` both need to wait, so how would they block... they need some sort of blocking primitive to Signal on... Do you, see where I am going with this?
-
-This is the true beauty of Pulse’s design. The blocking primitives are all composable. Select is just waiting on one or more Signals. It will assert its pulse once any of the signals are ready. This is much like an Logical OR gate. And Like a logical OR gate, they can be chained*.
-
-![or](https://raw.githubusercontent.com/csherratt/pulse/master/.images/or_gate.png)
-
-What if you want to wait for all the signals to assert before you continue? You could, just do something like this:
-
-```rust
-for signal in signals {
-    signal.wait();
-}
-```
-
-But now you are going to wake up every time a signal is ready. That could be quite a few contexts switches. We need an AND gate or a Barrier of some sort.
-
-```rust
-// A barrier of all the signals, waits until they are all ready
-Barrier::new(&signals).wait();
-```
-
-![and](https://raw.githubusercontent.com/csherratt/pulse/master/.images/and_gate.png)
-
-Of course a Barrier is just a Signal too... you can wire it into a Select, or another barrier.. It’s _all_ composable.
-
-It gets better:
----------------
-
-These large signal chains can be used to easily build your own fancy dancy work scheduler. Since a Signal can represent a wait point, You can map Signal to continuation. When the Signal asserts as ready, the continuation is ready to run. There are every provision to change the meaning of a `wait`, which makes Pulse useful for writing a custom fiber/green threads/coroutine implementation. :D
-
-There must be some ugly part to all of this?
---------------------------------------------
-
-And there is, Pulse does not magically make your hyper faster channel work in all cases. It is still a hard problem to know when things need to be woken up. If you install a pulse, and another thread enqueues at the same time you have to make sure you have not left yourself in a situation where no thread will trigger the pulse. 
-
-My recommended strategy is to double check conditions, once before you install the Pulse (the fast path) and once after. The thread that installed the pulse can uninstall its own pulse and trigger it. But there be dragons.
-
-You can use a library like [atom](https://github.com/csherratt/atom) to store a Pulse inside of a data structure without a lock.
-
-Why is it called Pulse?
------------------------
-
- 1. Because someone already claimed `Event` on crates.io
- 2. It's common way to set a flip-flop in hardware. You send a signal in the form a pulse, the flip-flop gets set and assets a high signal.
-That signal can go to an AND gate, or an OR gate... ect ect.
-
-Is it 1.0.0 Compatible?
-------------------------
-
-Yes. By default it uses only stable api's. There is experimental support for callbacks that is not compatible with rust 1.0.0, but that is hidden behind a feature flag.
diff --git a/vendor/pulse/benches/benches.rs b/vendor/pulse/benches/benches.rs
deleted file mode 100644
index fe661e4..0000000
--- a/vendor/pulse/benches/benches.rs
+++ /dev/null
@@ -1,71 +0,0 @@
-//   Copyright 2015 Colin Sherratt
-//
-//   Licensed under the Apache License, Version 2.0 (the "License");
-//   you may not use this file except in compliance with the License.
-//   You may obtain a copy of the License at
-//
-//       http://www.apache.org/licenses/LICENSE-2.0
-//
-//   Unless required by applicable law or agreed to in writing, software
-//   distributed under the License is distributed on an "AS IS" BASIS,
-//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//   See the License for the specific language governing permissions and
-//   limitations under the License.
-
-
-#![feature(test)]
-
-extern crate test;
-extern crate pulse;
-
-use std::sync::mpsc::channel;
-use std::sync::Mutex;
-use test::Bencher;
-use pulse::*;
-
-#[bench]
-fn pulse_already_set(b: &mut Bencher) {
-    let (p, t)  = Signal::new();
-    t.pulse();
-
-    b.iter(|| {
-        p.is_pending();
-    });
-}
-
-#[bench]
-fn pulse_create_and_set(b: &mut Bencher) {
-    b.iter(|| {
-        let (p, t)  = Signal::new();
-        t.pulse();
-        p.wait().unwrap();
-    });
-}
-
-/*#[bench]
-fn pulse_set(b: &mut Bencher) {
-    let (mut p, _) = Signal::new();
-
-    b.iter(|| {
-        let t = p.recycle().unwrap();
-        t.pulse();
-        p.wait().unwrap();
-    });
-}*/
-
-#[bench]
-fn mutex_lock_time(b: &mut Bencher) {
-    let mutex = Mutex::new(7);
-    b.iter(|| {
-        drop(mutex.lock().unwrap());
-    });
-}
-
-#[bench]
-fn oneshot_channel(b: &mut Bencher) {
-    b.iter(|| {
-        let (tx, rx) = channel();
-        tx.send(()).unwrap();
-        rx.recv().unwrap();
-    });
-}
\ No newline at end of file
diff --git a/vendor/pulse/src/barrier.rs b/vendor/pulse/src/barrier.rs
deleted file mode 100644
index 259ac54..0000000
--- a/vendor/pulse/src/barrier.rs
+++ /dev/null
@@ -1,62 +0,0 @@
-//   Copyright 2015 Colin Sherratt
-//
-//   Licensed under the Apache License, Version 2.0 (the "License");
-//   you may not use this file except in compliance with the License.
-//   You may obtain a copy of the License at
-//
-//       http://www.apache.org/licenses/LICENSE-2.0
-//
-//   Unless required by applicable law or agreed to in writing, software
-//   distributed under the License is distributed on an "AS IS" BASIS,
-//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//   See the License for the specific language governing permissions and
-//   limitations under the License.
-
-use std::sync::atomic::{AtomicUsize, Ordering};
-use std::sync::{Arc, Mutex};
-
-use {Pulse, Signal, Waiting, Signals};
-
-pub struct Inner {
-    pub count: AtomicUsize,
-    pub trigger: Mutex<Option<Pulse>>,
-}
-
-/// A `Barrier` can listen for 1 or more `Signals`. It will only transition
-/// to a `Pulsed` state once all the `Signals` have `Pulsed`.
-pub struct Barrier {
-    inner: Arc<Inner>,
-}
-
-pub struct Handle(pub Arc<Inner>);
-
-impl Barrier {
-    /// Create a new Barrier from an Vector of `Siganl`s
-    pub fn new(pulses: &[Signal]) -> Barrier {
-        // count items
-        let inner = Arc::new(Inner {
-            count: AtomicUsize::new(pulses.len()),
-            trigger: Mutex::new(None),
-        });
-
-        for pulse in pulses {
-            pulse.clone().arm(Waiting::barrier(Handle(inner.clone())));
-        }
-
-        Barrier { inner: inner }
-    }
-}
-
-impl Signals for Barrier {
-    fn signal(&self) -> Signal {
-        let (p, t) = Signal::new();
-
-        let mut guard = self.inner.trigger.lock().unwrap();
-        if self.inner.count.load(Ordering::Relaxed) == 0 {
-            t.pulse();
-        } else {
-            *guard = Some(t);
-        }
-        p
-    }
-}
diff --git a/vendor/pulse/src/fnbox.rs b/vendor/pulse/src/fnbox.rs
deleted file mode 100644
index dfe0ab5..0000000
--- a/vendor/pulse/src/fnbox.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-pub trait FnBox {
-    fn call_box(self: Box<Self>);
-}
-
-impl<F: FnOnce()> FnBox for F {
-    fn call_box(self: Box<Self>) {
-        (*self)()
-    }
-}
diff --git a/vendor/pulse/src/lib.rs b/vendor/pulse/src/lib.rs
deleted file mode 100644
index f874e76..0000000
--- a/vendor/pulse/src/lib.rs
+++ /dev/null
@@ -1,575 +0,0 @@
-//   Copyright 2015 Colin Sherratt
-//
-//   Licensed under the Apache License, Version 2.0 (the "License");
-//   you may not use this file except in compliance with the License.
-//   You may obtain a copy of the License at
-//
-//       http://www.apache.org/licenses/LICENSE-2.0
-//
-//   Unless required by applicable law or agreed to in writing, software
-//   distributed under the License is distributed on an "AS IS" BASIS,
-//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//   See the License for the specific language governing permissions and
-//   limitations under the License.
-
-extern crate atom;
-extern crate time;
-
-use std::sync::atomic::AtomicUsize;
-use std::thread;
-use std::mem;
-use std::fmt;
-use std::ops::Deref;
-use std::sync::atomic::Ordering;
-use std::cell::RefCell;
-
-use atom::*;
-use time::precise_time_s;
-use fnbox::FnBox;
-
-pub use select::{Select, SelectMap};
-pub use barrier::Barrier;
-mod select;
-mod barrier;
-mod fnbox;
-
-/// Drop rules
-/// This may be freed iff state is Signald | Dropped
-/// and Waiting is Dropped
-struct Inner {
-    state: AtomicUsize,
-    waiting: Atom<Box<Waiting>>,
-}
-
-// TODO 64bit sized, probably does not matter now
-const PULSED: usize = 0x8000_0000;
-const TX_DROP: usize = 0x4000_0000;
-const TX_FLAGS: usize = PULSED | TX_DROP;
-const REF_COUNT: usize = !TX_FLAGS;
-
-struct Waiting {
-    next: Option<Box<Waiting>>,
-    wake: Wake,
-}
-
-impl GetNextMut for Box<Waiting> {
-    type NextPtr = Option<Box<Waiting>>;
-
-    fn get_next(&mut self) -> &mut Option<Box<Waiting>> {
-        &mut self.next
-    }
-}
-
-enum Wake {
-    Thread(thread::Thread),
-    Select(select::Handle),
-    Barrier(barrier::Handle),
-    Callback(Box<FnBox>),
-}
-
-impl Waiting {
-    fn wake(s: Box<Self>, id: usize) {
-        let mut next = Some(s);
-        while let Some(s) = next {
-            // There must be a better way to do this...
-            let s = *s;
-            let Waiting { next: n, wake } = s;
-            next = n;
-            match wake {
-                Wake::Thread(thread) => thread.unpark(),
-                Wake::Select(select) => {
-                    let trigger = {
-                        let mut guard = select.0.lock().unwrap();
-                        guard.ready.push(id);
-                        guard.trigger.take()
-                    };
-                    trigger.map(|x| x.pulse());
-                }
-                Wake::Barrier(barrier) => {
-                    let count = barrier.0.count.fetch_sub(1, Ordering::Relaxed);
-                    if count == 1 {
-                        let mut guard = barrier.0.trigger.lock().unwrap();
-                        if let Some(t) = guard.take() {
-                            t.pulse();
-                        }
-                    }
-                }
-                Wake::Callback(cb) => cb.call_box(),
-            }
-        }
-    }
-
-    fn id(&self) -> usize {
-        unsafe { mem::transmute(self) }
-    }
-
-    fn thread() -> Box<Waiting> {
-        Box::new(Waiting {
-            next: None,
-            wake: Wake::Thread(thread::current()),
-        })
-    }
-
-    fn select(handle: select::Handle) -> Box<Waiting> {
-        Box::new(Waiting {
-            next: None,
-            wake: Wake::Select(handle),
-        })
-    }
-
-    fn barrier(handle: barrier::Handle) -> Box<Waiting> {
-        Box::new(Waiting {
-            next: None,
-            wake: Wake::Barrier(handle),
-        })
-    }
-
-    fn callback<F>(cb: F) -> Box<Waiting>
-        where F: FnOnce() + 'static
-    {
-        Box::new(Waiting {
-            next: None,
-            wake: Wake::Callback(Box::new(cb)),
-        })
-    }
-}
-
-unsafe impl Send for Pulse {}
-// This should be safe a pulse requires ownership to
-// actually `pulse`
-unsafe impl Sync for Pulse {}
-
-/// A `Pulse` is represents an unfired signal. It is the tx side of Signal
-/// A `Pulse` can only purpose it to be fired, and then it will be moved
-/// as to never allow it to fire again. `Dropping` a pulse will `pulse`
-/// The signal, but the signal will enter an error state.
-pub struct Pulse {
-    inner: *mut Inner,
-}
-
-impl fmt::Debug for Pulse {
-    fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
-        let id: usize = unsafe { mem::transmute(self.inner) };
-        write!(f, "Pulse({:?})", id)
-    }
-}
-
-fn delete_inner(state: usize, inner: *mut Inner) {
-    if state & REF_COUNT == 1 {
-        let inner: Box<Inner> = unsafe { mem::transmute(inner) };
-        drop(inner);
-    }
-}
-
-impl Drop for Pulse {
-    fn drop(&mut self) {
-        self.set(TX_DROP);
-        self.wake();
-        let state = self.inner().state.fetch_sub(1, Ordering::Relaxed);
-        delete_inner(state, self.inner)
-    }
-}
-
-impl Pulse {
-    /// Create a Pulse from a usize. This is naturally unsafe.
-    #[inline]
-    pub unsafe fn cast_from_usize(ptr: usize) -> Pulse {
-        Pulse { inner: mem::transmute(ptr) }
-    }
-
-    /// Convert a trigger to a `usize`, This is unsafe
-    /// and it will kill your kittens if you are not careful
-    #[inline]
-    pub unsafe fn cast_to_usize(self) -> usize {
-        let us = mem::transmute(self.inner);
-        mem::forget(self);
-        us
-    }
-
-    #[inline]
-    fn inner(&self) -> &Inner {
-        unsafe { mem::transmute(self.inner) }
-    }
-
-    #[inline]
-    fn set(&self, state: usize) -> usize {
-        self.inner().state.fetch_or(state, Ordering::Relaxed)
-    }
-
-    #[inline]
-    fn wake(&self) {
-        let id = unsafe { mem::transmute(self.inner) };
-        match self.inner().waiting.take() {
-            None => (),
-            Some(v) => Waiting::wake(v, id),
-        }
-    }
-
-    /// Pulse the `pulse` which will transition the `Signal` out from pending
-    /// to ready. This moves the pulse so that it can only be fired once.
-    #[inline]
-    pub fn pulse(self) {
-        self.set(PULSED);
-        self.wake();
-
-        let state = self.inner().state.fetch_sub(1, Ordering::Relaxed);
-        delete_inner(state, self.inner);
-        mem::forget(self)
-    }
-}
-
-
-unsafe impl Send for Signal {}
-// This should be safe a signal requires ownership to do anything
-// the inner is all atomically modified data anyhow
-unsafe impl Sync for Signal {}
-
-/// A `Signal` represents listens for a `pulse` to occur in the system. A
-/// `Signal` has one of three states. Pending, Pulsed, or Errored. Pending
-/// means the pulse has not fired, but still exists. Pulsed meaning the 
-/// pulse has fired, and no longer exists. Errored means the pulse was dropped
-/// without firing. This normally means a programming error of some sort.
-pub struct Signal {
-    inner: *mut Inner,
-}
-
-impl fmt::Debug for Signal {
-    fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
-        write!(f,
-               "Signal(id={:?}, pending={:?})",
-               self.id(),
-               self.is_pending())
-    }
-}
-
-impl Clone for Signal {
-    #[inline(always)]
-    fn clone(&self) -> Signal {
-        self.inner().state.fetch_add(1, Ordering::Relaxed);
-        Signal { inner: self.inner }
-    }
-}
-
-impl Drop for Signal {
-    #[inline]
-    fn drop(&mut self) {
-        let flag = self.inner().state.fetch_sub(1, Ordering::Relaxed);
-        delete_inner(flag, self.inner);
-    }
-}
-
-impl Signal {
-    /// Create a Signal and a Pulse that are associated.
-    pub fn new() -> (Signal, Pulse) {
-        let inner = Box::new(Inner {
-            state: AtomicUsize::new(2),
-            waiting: Atom::empty(),
-        });
-
-        let inner = unsafe { mem::transmute(inner) };
-
-        (Signal { inner: inner }, Pulse { inner: inner })
-    }
-
-    /// Create a signal that is already pulsed
-    pub fn pulsed() -> Signal {
-        let inner = Box::new(Inner {
-            state: AtomicUsize::new(1 | PULSED),
-            waiting: Atom::empty(),
-        });
-
-        let inner = unsafe { mem::transmute(inner) };
-
-        Signal { inner: inner }
-    }
-
-    #[inline]
-    fn inner(&self) -> &Inner {
-        unsafe { mem::transmute(self.inner) }
-    }
-
-    /// Read out the state of the Signal
-    #[inline]
-    pub fn state(&self) -> SignalState {
-        let flags = self.inner().state.load(Ordering::Relaxed);
-        match (flags & TX_DROP == TX_DROP, flags & PULSED == PULSED) {
-            (_, true) => SignalState::Pulsed,
-            (true, _) => SignalState::Dropped,
-            (_, _) => SignalState::Pending,
-        }
-    }
-
-    /// Check to see if the signal is pending. A signal 
-    #[inline]
-    pub fn is_pending(&self) -> bool {
-        self.state() == SignalState::Pending
-    }
-
-    /// Add a waiter to a waitlist
-    fn add_to_waitlist(&self, waiter: Box<Waiting>) -> usize {
-        let id = waiter.id();
-
-        if !self.is_pending() {
-            Waiting::wake(waiter, self.id());
-            return id;
-        }
-
-        self.inner().waiting.replace_and_set_next(waiter);
-
-        // if armed fire now
-        if !self.is_pending() {
-            if let Some(t) = self.inner().waiting.take() {
-                Waiting::wake(t, self.id());
-            }
-        }
-        id
-    }
-
-    /// Remove Waiter with `id` from the waitlist
-    fn remove_from_waitlist(&self, id: usize) {
-        let mut wl = self.inner().waiting.take();
-        while let Some(mut w) = wl {
-            let next = w.next.take();
-            if w.id() != id {
-                self.add_to_waitlist(w);
-            }
-            wl = next;
-        }
-    }
-
-    /// Arm a pulse to wake 
-    fn arm(self, waiter: Box<Waiting>) -> ArmedSignal {
-        let id = self.add_to_waitlist(waiter);
-        ArmedSignal {
-            id: id,
-            pulse: self,
-        }
-    }
-
-    /// This is a unique id that can be used to identify the signal from others
-    /// See `Select` for how this api is useful.
-    pub fn id(&self) -> usize {
-        unsafe { mem::transmute_copy(&self.inner) }
-    }
-
-    /// Block the current thread until a `pulse` is ready.
-    /// This will block indefinably if the pulse never fires.
-    #[inline]
-    pub fn wait(self) -> Result<(), WaitError> {
-        match self.state() {
-            SignalState::Pulsed => Ok(()),
-            SignalState::Dropped => Err(WaitError::Dropped),
-            SignalState::Pending => {
-                let s = take_scheduler().expect("no scheduler found");
-                let res = s.wait(self);
-                swap_scheduler(s);
-                res
-            }
-        }
-    }
-
-    /// Block until either the pulse is sent, or the timeout is reached
-    pub fn wait_timeout_ms(self, ms: u32) -> Result<(), TimeoutError> {
-        SCHED.with(|sched| {
-            let s = sched.borrow_mut().take().expect("Waited while: no scheduler installed");
-            let res = s.wait_timeout_ms(self, ms);
-            *sched.borrow_mut() = Some(s);
-            res
-        })
-    }
-
-    pub fn callback<F>(self, cb: F)
-        where F: FnOnce() + 'static
-    {
-        self.add_to_waitlist(Waiting::callback(cb));
-    }
-}
-
-/// Described the possible states of a Signal
-#[derive(Debug, PartialEq, Eq)]
-pub enum SignalState {
-    Pending,
-    Pulsed,
-    Dropped,
-}
-
-impl IntoRawPtr for Pulse {
-    #[inline(always)]
-    unsafe fn into_raw(self) -> *mut () {
-        let inner = self.inner;
-        mem::forget(self);
-        mem::transmute(inner)
-    }
-}
-
-impl FromRawPtr for Pulse {
-    #[inline(always)]
-    unsafe fn from_raw(ptr: *mut ()) -> Pulse {
-        Pulse { inner: mem::transmute(ptr) }
-    }
-}
-
-impl IntoRawPtr for Signal {
-    #[inline(always)]
-    unsafe fn into_raw(self) -> *mut () {
-        let inner = self.inner;
-        mem::forget(self);
-        mem::transmute(inner)
-    }
-}
-
-impl FromRawPtr for Signal {
-    #[inline(always)]
-    unsafe fn from_raw(ptr: *mut ()) -> Signal {
-        Signal { inner: mem::transmute(ptr) }
-    }
-}
-
-/// Represents the possible errors that can occur on a `Signal`
-#[derive(Debug, PartialEq, Eq)]
-pub enum WaitError {
-    /// The `Pulse` was dropped before it could `Pulse`
-    Dropped,
-}
-
-/// Represents the possible errors from a wait timeout
-#[derive(Debug, PartialEq, Eq)]
-pub enum TimeoutError {
-    /// A `WaitError` has occurred
-    Error(WaitError),
-    /// The `Signal` timed-out before a `Pulse` was observed.
-    Timeout,
-}
-
-struct ArmedSignal {
-    pulse: Signal,
-    id: usize,
-}
-
-impl Deref for ArmedSignal {
-    type Target = Signal;
-
-    fn deref(&self) -> &Signal {
-        &self.pulse
-    }
-}
-
-impl ArmedSignal {
-    fn disarm(self) -> Signal {
-        self.remove_from_waitlist(self.id);
-        self.pulse
-    }
-}
-
-/// allows an object to assert a wait signal
-pub trait Signals {
-    /// Get a signal from a object
-    fn signal(&self) -> Signal;
-
-    /// Block the current thread until the object
-    /// assets a pulse.
-    fn wait(&self) -> Result<(), WaitError> {
-        let signal = self.signal();
-        signal.wait()
-    }
-
-    /// Block the current thread until the object
-    /// assets a pulse. Or until the timeout has been asserted.
-    fn wait_timeout_ms(&self, ms: u32) -> Result<(), TimeoutError> {
-        let signal = self.signal();
-        signal.wait_timeout_ms(ms)
-    }
-}
-
-/// This is the hook into the async wait methods provided
-/// by `pulse`. It is required for the user to override
-/// the current system scheduler.
-pub trait Scheduler: std::fmt::Debug {
-    /// Wait until the signal is made `ready` or `errored`
-    fn wait(&self, signal: Signal) -> Result<(), WaitError>;
-
-    /// Wait until the signal is made `ready` or `errored` or the
-    /// timeout has been reached.
-    fn wait_timeout_ms(&self, signal: Signal, timeout: u32) -> Result<(), TimeoutError>;
-}
-
-/// This is the `default` system scheduler that is used if no
-/// user provided scheduler is installed. It is very basic
-/// and will block the OS thread using `thread::park`
-#[derive(Debug)]
-pub struct ThreadScheduler;
-
-impl Scheduler for ThreadScheduler {
-    fn wait(&self, signal: Signal) -> Result<(), WaitError> {
-        loop {
-            let id = signal.add_to_waitlist(Waiting::thread());
-            if signal.is_pending() {
-                thread::park();
-            }
-            signal.remove_from_waitlist(id);
-
-            match signal.state() {
-                SignalState::Pending => (),
-                SignalState::Pulsed => return Ok(()),
-                SignalState::Dropped => return Err(WaitError::Dropped),
-            }
-        }
-    }
-
-    fn wait_timeout_ms(&self, signal: Signal, ms: u32) -> Result<(), TimeoutError> {
-        let mut now = (precise_time_s() * 1000.) as u64;
-        let end = now + ms as u64;
-
-        loop {
-            let id = signal.add_to_waitlist(Waiting::thread());
-            if signal.is_pending() {
-                now = (precise_time_s() * 1000.) as u64;
-                if now > end {
-                    return Err(TimeoutError::Timeout);
-                }
-                thread::park_timeout_ms((end - now) as u32);
-            }
-            signal.remove_from_waitlist(id);
-
-            match signal.state() {
-                SignalState::Pending => (),
-                SignalState::Pulsed => return Ok(()),
-                SignalState::Dropped => return Err(TimeoutError::Error(WaitError::Dropped)),
-            }
-        }
-    }
-}
-
-/// The TLS scheduler
-thread_local!(static SCHED: RefCell<Option<Box<Scheduler>>> = RefCell::new(Some(Box::new(ThreadScheduler))));
-
-// this is inline never to avoid the SCHED pointer being cached
-#[inline(never)]
-fn take_scheduler() -> Option<Box<Scheduler>> {
-    use std::mem;
-    let mut sched = None;
-    SCHED.with(|s| mem::swap(&mut *s.borrow_mut(), &mut sched));
-    sched
-}
-
-/// Replace the current Scheduler with your own supplied scheduler.
-/// all `wait()` commands will be run through this scheduler now.
-///
-/// This will return the current TLS scheduler, which may be useful
-/// to restore it later.
-#[inline(never)]
-pub fn swap_scheduler(sched: Box<Scheduler>) -> Option<Box<Scheduler>> {
-    use std::mem;
-    let mut sched = Some(sched);
-    SCHED.with(|s| mem::swap(&mut *s.borrow_mut(), &mut sched));
-    sched
-}
-
-/// Call the suppled closure using the supplied schedulee
-pub fn with_scheduler<F>(f: F, sched: Box<Scheduler>) -> Option<Box<Scheduler>>
-    where F: FnOnce()
-{
-    let old = swap_scheduler(sched);
-    f();
-    old.and_then(|o| swap_scheduler(o))
-}
diff --git a/vendor/pulse/src/lib.rs.bk b/vendor/pulse/src/lib.rs.bk
deleted file mode 100644
index 29ea9e9..0000000
--- a/vendor/pulse/src/lib.rs.bk
+++ /dev/null
@@ -1,573 +0,0 @@
-//   Copyright 2015 Colin Sherratt
-//
-//   Licensed under the Apache License, Version 2.0 (the "License");
-//   you may not use this file except in compliance with the License.
-//   You may obtain a copy of the License at
-//
-//       http://www.apache.org/licenses/LICENSE-2.0
-//
-//   Unless required by applicable law or agreed to in writing, software
-//   distributed under the License is distributed on an "AS IS" BASIS,
-//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//   See the License for the specific language governing permissions and
-//   limitations under the License.
-
-extern crate atom;
-extern crate time;
-
-use std::sync::atomic::{AtomicUsize};
-use std::thread;
-use std::mem;
-use std::fmt;
-use std::ops::Deref;
-use std::sync::atomic::Ordering;
-use std::cell::RefCell;
-
-use atom::*;
-use time::precise_time_s;
-use fnbox::FnBox;
-
-pub use select::{Select, SelectMap};
-pub use barrier::Barrier;
-mod select;
-mod barrier;
-mod fnbox;
-
-/// Drop rules
-/// This may be freed iff state is Signald | Dropped
-/// and Waiting is Dropped
-struct Inner {
-    state: AtomicUsize,
-    waiting: Atom<Box<Waiting>>
-}
-
-// TODO 64bit sized, probably does not matter now
-const PULSED: usize = 0x8000_0000;
-const TX_DROP: usize = 0x4000_0000;
-const TX_FLAGS: usize = PULSED | TX_DROP;
-const REF_COUNT: usize = !TX_FLAGS;
-
-struct Waiting {
-    next: Option<Box<Waiting>>,
-    wake: Wake
-}
-
-impl GetNextMut for Box<Waiting> {
-    type NextPtr = Option<Box<Waiting>>;
-
-    fn get_next(&mut self) -> &mut Option<Box<Waiting>> {
-        &mut self.next
-    }
-}
-
-enum Wake {
-    Thread(thread::Thread),
-    Select(select::Handle),
-    Barrier(barrier::Handle),
-    Callback(Box<FnBox>)
-}
-
-impl Waiting {
-    fn wake(s: Box<Self>, id: usize) {
-        let mut next = Some(s);
-        while let Some(s) = next {
-            // There must be a better way to do this...
-            let s = *s;
-            let Waiting { next: n, wake } = s;
-            next = n;
-            match wake {
-                Wake::Thread(thread) => thread.unpark(),
-                Wake::Select(select) => {
-                    let trigger = {
-                        let mut guard = select.0.lock().unwrap();
-                        guard.ready.push(id);
-                        guard.trigger.take()
-                    };
-                    trigger.map(|x| x.pulse());
-                }
-                Wake::Barrier(barrier) => {
-                    let count = barrier.0.count.fetch_sub(1, Ordering::Relaxed);
-                    if count == 1 {
-                        let mut guard = barrier.0.trigger.lock().unwrap();
-                        if let Some(t) = guard.take() {
-                            t.pulse();
-                        }
-                    }
-                }
-                Wake::Callback(cb) => cb.call_box(),
-            }
-        }
-    }
-
-    fn id(&self) -> usize {
-        unsafe { mem::transmute(self) }
-    }
-
-    fn thread() -> Box<Waiting> {
-        Box::new(Waiting {
-            next: None,
-            wake: Wake::Thread(thread::current())
-        })
-    }
-
-    fn select(handle: select::Handle) -> Box<Waiting> {
-        Box::new(Waiting{
-            next: None,
-            wake: Wake::Select(handle)
-        })
-    }
-
-    fn barrier(handle: barrier::Handle) -> Box<Waiting> {
-        Box::new(Waiting{
-            next: None,
-            wake: Wake::Barrier(handle)
-        })
-    }
-
-    fn callback<F>(cb: F) -> Box<Waiting> where F: FnOnce() + 'static {
-        Box::new(Waiting{
-            next: None,
-            wake: Wake::Callback(Box::new(cb))
-        })
-    }
-}
-
-unsafe impl Send for Pulse {}
-// This should be safe a pulse requires ownership to
-// actually `pulse`
-unsafe impl Sync for Pulse {}
-
-/// A `Pulse` is represents an unfired signal. It is the tx side of Signal
-/// A `Pulse` can only purpose it to be fired, and then it will be moved
-/// as to never allow it to fire again. `Dropping` a pulse will `pulse`
-/// The signal, but the signal will enter an error state.
-pub struct Pulse {
-    inner: *mut Inner
-}
-
-impl fmt::Debug for Pulse {
-    fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
-        let id: usize = unsafe { mem::transmute(self.inner) };
-        write!(f, "Pulse({:?})", id)
-    }
-}
-
-fn delete_inner(state: usize, inner: *mut Inner) {
-    if state & REF_COUNT == 1 {
-        let inner: Box<Inner> = unsafe {
-            mem::transmute(inner)
-        };
-        drop(inner);
-    }
-}
-
-impl Drop for Pulse {
-    fn drop(&mut self) {
-        self.set(TX_DROP);
-        self.wake();
-        let state = self.inner().state.fetch_sub(1, Ordering::Relaxed);
-        delete_inner(state, self.inner)
-    }
-}
-
-impl Pulse {
-    /// Create a Pulse from a usize. This is naturally unsafe.
-    #[inline]
-    pub unsafe fn cast_from_usize(ptr: usize) -> Pulse {
-        Pulse {
-            inner: mem::transmute(ptr)
-        }
-    }
-
-    /// Convert a trigger to a `usize`, This is unsafe
-    /// and it will kill your kittens if you are not careful
-    #[inline]
-    pub unsafe fn cast_to_usize(self) -> usize {
-        let us = mem::transmute(self.inner);
-        mem::forget(self);
-        us
-    }
-
-    #[inline]
-    fn inner(&self) -> &Inner {
-        unsafe { mem::transmute(self.inner) }
-    }
-
-    #[inline]
-    fn set(&self, state: usize) -> usize {
-        self.inner().state.fetch_or(state, Ordering::Relaxed)
-    }
-
-    #[inline]
-    fn wake(&self) {
-        let id = unsafe { mem::transmute(self.inner) };
-        match self.inner().waiting.take() {
-            None => (),
-            Some(v) => Waiting::wake(v, id)
-        }
-    }
-
-    /// Pulse the `pulse` which will transition the `Signal` out from pending
-    /// to ready. This moves the pulse so that it can only be fired once.
-    #[inline]
-    pub fn pulse(self) {
-        self.set(PULSED);
-        self.wake();
-
-        let state = self.inner().state.fetch_sub(1, Ordering::Relaxed);
-        delete_inner(state, self.inner);
-        mem::forget(self)
-    }
-}
-
-
-unsafe impl Send for Signal {}
-// This should be safe a signal requires ownership to do anything
-// the inner is all atomically modified data anyhow
-unsafe impl Sync for Signal {}
-
-/// A `Signal` represents listens for a `pulse` to occur in the system. A
-/// `Signal` has one of three states. Pending, Pulsed, or Errored. Pending
-/// means the pulse has not fired, but still exists. Pulsed meaning the 
-/// pulse has fired, and no longer exists. Errored means the pulse was dropped
-/// without firing. This normally means a programming error of some sort.
-pub struct Signal {
-    inner: *mut Inner
-}
-
-impl fmt::Debug for Signal {
-    fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
-        write!(f, "Signal(id={:?}, pending={:?})", self.id(), self.is_pending())
-    }
-}
-
-impl Clone for Signal {
-    #[inline(always)]
-    fn clone(&self) -> Signal {
-        self.inner().state.fetch_add(1, Ordering::Relaxed);
-        Signal { inner: self.inner }
-    }
-}
-
-impl Drop for Signal {
-    #[inline]
-    fn drop(&mut self) {
-        let flag = self.inner().state.fetch_sub(1, Ordering::Relaxed);
-        delete_inner(flag, self.inner);
-    }
-}
-
-impl Signal {
-    /// Create a Signal and a Pulse that are associated.
-    pub fn new() -> (Signal, Pulse) {
-        let inner = Box::new(Inner {
-            state: AtomicUsize::new(2),
-            waiting: Atom::empty()
-        });
-
-        let inner = unsafe {mem::transmute(inner)};
-
-        (Signal {
-            inner: inner
-         },
-         Pulse {
-            inner: inner,
-        })
-    }
-
-    /// Create a signal that is already pulsed
-    pub fn pulsed() -> Signal {
-        let inner = Box::new(Inner {
-            state: AtomicUsize::new(1 | PULSED),
-            waiting: Atom::empty()
-        });
-
-        let inner = unsafe {mem::transmute(inner)};
-
-        Signal { inner: inner }
-    }
-
-    #[inline]
-    fn inner(&self) -> &Inner {
-        unsafe { mem::transmute(self.inner) }
-    }
-
-    /// Read out the state of the Signal
-    #[inline]
-    pub fn state(&self) -> SignalState {
-        let flags = self.inner().state.load(Ordering::Relaxed);
-        match (flags & TX_DROP == TX_DROP, flags & PULSED == PULSED) {
-            (_, true) => SignalState::Pulsed,
-            (true, _) => SignalState::Dropped,
-            (_, _) => SignalState::Pending
-        }
-    }
-
-    /// Check to see if the signal is pending. A signal 
-    #[inline]
-    pub fn is_pending(&self) -> bool {
-        self.state() == SignalState::Pending
-    }
-
-    /// Add a waiter to a waitlist
-    fn add_to_waitlist(&self, waiter: Box<Waiting>) -> usize {
-        let id = waiter.id();
-
-        if !self.is_pending() {
-            Waiting::wake(waiter, self.id());
-            return id;
-        }
-
-        self.inner().waiting.replace_and_set_next(waiter);
-
-        // if armed fire now
-        if !self.is_pending() {
-            if let Some(t) = self.inner().waiting.take() {
-                Waiting::wake(t, self.id());
-            }
-        }
-        id
-    }
-
-    /// Remove Waiter with `id` from the waitlist
-    fn remove_from_waitlist(&self, id: usize) {
-        let mut wl = self.inner().waiting.take();
-        while let Some(mut w) = wl {
-            let next = w.next.take();
-            if w.id() != id {
-                self.add_to_waitlist(w);
-            }
-            wl = next;
-        }
-    }
-
-    /// Arm a pulse to wake 
-    fn arm(self, waiter: Box<Waiting>) -> ArmedSignal {
-        let id = self.add_to_waitlist(waiter);
-        ArmedSignal {
-            id: id,
-            pulse: self
-        }
-    }
-
-    /// This is a unique id that can be used to identify the signal from others
-    /// See `Select` for how this api is useful.
-    pub fn id(&self) -> usize {
-        unsafe { mem::transmute_copy(&self.inner) }
-    }
-
-    /// Block the current thread until a `pulse` is ready.
-    /// This will block indefinably if the pulse never fires.
-    #[inline]
-    pub fn wait(self) -> Result<(), WaitError> {
-        match self.state() {
-            SignalState::Pulsed => Ok(()),
-            SignalState::Dropped => Err(WaitError::Dropped),
-            SignalState::Pending => {
-                let s = take_scheduler().expect("no scheduler found");
-                let res = s.wait(self);
-                swap_scheduler(s);
-                res
-            }
-        }
-    }
-
-    /// Block until either the pulse is sent, or the timeout is reached
-    pub fn wait_timeout_ms(self, ms: u32) -> Result<(), TimeoutError> {
-        SCHED.with(|sched| {
-            let s = sched.borrow_mut().take().expect("Waited while: no scheduler installed");
-            let res = s.wait_timeout_ms(self, ms);
-            *sched.borrow_mut() = Some(s);
-            res
-        })
-    }
-
-    pub fn callback<F>(self, cb: F) where F: FnOnce() + 'static {
-        self.add_to_waitlist(Waiting::callback(cb));
-    }
-}
-
-/// Described the possible states of a Signal
-#[derive(Debug, PartialEq, Eq)]
-pub enum SignalState {
-    Pending,
-    Pulsed,
-    Dropped
-}
-
-impl IntoRawPtr for Pulse {
-    #[inline(always)]
-    unsafe fn into_raw(self) -> *mut () {
-        let inner = self.inner;
-        mem::forget(self);
-        mem::transmute(inner)
-    }
-}
-
-impl FromRawPtr for Pulse {
-    #[inline(always)]
-    unsafe fn from_raw(ptr: *mut ()) -> Pulse {
-        Pulse { inner: mem::transmute(ptr) }
-    }
-}
-
-impl IntoRawPtr for Signal {
-    #[inline(always)]
-    unsafe fn into_raw(self) -> *mut () {
-        let inner = self.inner;
-        mem::forget(self);
-        mem::transmute(inner)
-    }
-}
-
-impl FromRawPtr for Signal {
-    #[inline(always)]
-    unsafe fn from_raw(ptr: *mut ()) -> Signal {
-        Signal { inner: mem::transmute(ptr) }
-    }
-}
-
-/// Represents the possible errors that can occur on a `Signal`
-#[derive(Debug, PartialEq, Eq)]
-pub enum WaitError {
-    /// The `Pulse` was dropped before it could `Pulse`
-    Dropped
-}
-
-/// Represents the possible errors from a wait timeout
-#[derive(Debug, PartialEq, Eq)]
-pub enum TimeoutError {
-    /// A `WaitError` has occurred
-    Error(WaitError),
-    /// The `Signal` timed-out before a `Pulse` was observed.
-    Timeout
-}
-
-struct ArmedSignal {
-    pulse: Signal,
-    id: usize
-}
-
-impl Deref for ArmedSignal {
-    type Target = Signal;
-
-    fn deref(&self) -> &Signal { &self.pulse }
-}
-
-impl ArmedSignal {
-    fn disarm(self) -> Signal {
-        self.remove_from_waitlist(self.id);
-        self.pulse
-    }
-}
-
-/// allows an object to assert a wait signal
-pub trait Signals {
-    /// Get a signal from a object
-    fn signal(&self) -> Signal;
-
-    /// Block the current thread until the object
-    /// assets a pulse.
-    fn wait(&self) -> Result<(), WaitError> {
-        let signal = self.signal();
-        signal.wait()
-    }
-
-    /// Block the current thread until the object
-    /// assets a pulse. Or until the timeout has been asserted.
-    fn wait_timeout_ms(&self, ms: u32) -> Result<(), TimeoutError> {
-        let signal = self.signal();
-        signal.wait_timeout_ms(ms)
-    }
-}
-
-/// This is the hook into the async wait methods provided
-/// by `pulse`. It is required for the user to override
-/// the current system scheduler.
-pub trait Scheduler: std::fmt::Debug {
-    /// Wait until the signal is made `ready` or `errored`
-    fn wait(&self, signal: Signal) -> Result<(), WaitError>;
-
-    /// Wait until the signal is made `ready` or `errored` or the
-    /// timeout has been reached.
-    fn wait_timeout_ms(&self, signal: Signal, timeout: u32) -> Result<(), TimeoutError>;
-}
-
-/// This is the `default` system scheduler that is used if no
-/// user provided scheduler is installed. It is very basic
-/// and will block the OS thread using `thread::park`
-#[derive(Debug)]
-pub struct ThreadScheduler;
-
-impl Scheduler for ThreadScheduler {
-    fn wait(&self, signal: Signal) -> Result<(), WaitError> {
-        loop {
-            let id = signal.add_to_waitlist(Waiting::thread());
-            if signal.is_pending() {
-                thread::park();
-            }
-            signal.remove_from_waitlist(id);
-
-            match signal.state() {
-                SignalState::Pending => (),
-                SignalState::Pulsed => return Ok(()),
-                SignalState::Dropped => return Err(WaitError::Dropped)
-            }
-        }
-    }
-
-    fn wait_timeout_ms(&self, signal: Signal, ms: u32) -> Result<(), TimeoutError> {
-        let mut now = (precise_time_s() * 1000.) as u64;
-        let end = now + ms as u64;
-
-        loop {
-            let id = signal.add_to_waitlist(Waiting::thread());
-            if signal.is_pending() {
-                now = (precise_time_s() * 1000.) as u64;
-                if now > end {
-                    return Err(TimeoutError::Timeout)
-                }
-                thread::park_timeout_ms((end - now) as u32);
-            }
-            signal.remove_from_waitlist(id);
-
-            match signal.state() {
-                SignalState::Pending => (),
-                SignalState::Pulsed => return Ok(()),
-                SignalState::Dropped => return Err(TimeoutError::Error(WaitError::Dropped))
-            }
-        }
-    }
-}
-
-/// The TLS scheduler
-thread_local!(static SCHED: RefCell<Option<Box<Scheduler>>> = RefCell::new(Some(Box::new(ThreadScheduler))));
-
-// this is inline never to avoid the SCHED pointer being cached
-#[inline(never)]
-fn take_scheduler() -> Option<Box<Scheduler>> {
-    use std::mem;
-    let mut sched = None;
-    SCHED.with(|s| mem::swap(&mut *s.borrow_mut(), &mut sched));
-    sched
-}
-
-/// Replace the current Scheduler with your own supplied scheduler.
-/// all `wait()` commands will be run through this scheduler now.
-///
-/// This will return the current TLS scheduler, which may be useful
-/// to restore it later.
-#[inline(never)]
-pub fn swap_scheduler(sched: Box<Scheduler>) -> Option<Box<Scheduler>> {
-    use std::mem;
-    let mut sched = Some(sched);
-    SCHED.with(|s| mem::swap(&mut *s.borrow_mut(), &mut sched));
-    sched
-}
-
-/// Call the suppled closure using the supplied schedulee
-pub fn with_scheduler<F>(f: F, sched: Box<Scheduler>) -> Option<Box<Scheduler>> where F: FnOnce() {
-    let old = swap_scheduler(sched);
-    f();
-    old.and_then(|o| swap_scheduler(o))
-}
\ No newline at end of file
diff --git a/vendor/pulse/src/select.rs b/vendor/pulse/src/select.rs
deleted file mode 100644
index 701bf02..0000000
--- a/vendor/pulse/src/select.rs
+++ /dev/null
@@ -1,185 +0,0 @@
-//   Copyright 2015 Colin Sherratt
-//
-//   Licensed under the Apache License, Version 2.0 (the "License");
-//   you may not use this file except in compliance with the License.
-//   You may obtain a copy of the License at
-//
-//       http://www.apache.org/licenses/LICENSE-2.0
-//
-//   Unless required by applicable law or agreed to in writing, software
-//   distributed under the License is distributed on an "AS IS" BASIS,
-//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//   See the License for the specific language governing permissions and
-//   limitations under the License.
-
-
-use std::sync::{Arc, Mutex};
-use std::collections::HashMap;
-use {Signal, ArmedSignal, Pulse, Waiting, Barrier, Signals};
-
-pub struct Inner {
-    pub ready: Vec<usize>,
-    pub trigger: Option<Pulse>,
-}
-
-pub struct Handle(pub Arc<Mutex<Inner>>);
-
-/// A `Select` listens to 1 or more signals. It will wait until
-/// any signal becomes available before Pulsing. `Select` will then
-/// return the `Signal` that has been `Pulsed`. `Select` has no defined
-/// ordering of events for `Signal`s when there are more then one `Signals`
-/// pending.
-pub struct Select {
-    inner: Arc<Mutex<Inner>>,
-    signals: HashMap<usize, ArmedSignal>,
-}
-
-impl Select {
-    /// Create a new empty `Select`
-    pub fn new() -> Select {
-        Select {
-            inner: Arc::new(Mutex::new(Inner {
-                ready: Vec::new(),
-                trigger: None,
-            })),
-            signals: HashMap::new(),
-        }
-    }
-
-    /// Add a signal to the `Select`, a unique id that is associated
-    /// With the signal is returned. This can be used to remove the
-    /// signal from the `Select` or to lookup the `Pulse` when it fires.
-    pub fn add(&mut self, pulse: Signal) -> usize {
-        let id = pulse.id();
-        let p = pulse.arm(Waiting::select(Handle(self.inner.clone())));
-        self.signals.insert(id, p);
-        id
-    }
-
-    /// Remove a `Signal1 from the `Select` using it's unique id.
-    pub fn remove(&mut self, id: usize) -> Option<Signal> {
-        self.signals
-            .remove(&id)
-            .map(|x| x.disarm())
-    }
-
-    /// Convert all the signals present in the `Select` into a `Barrier`
-    pub fn into_barrier(self) -> Barrier {
-        let vec: Vec<Signal> = self.signals
-                                   .into_iter()
-                                   .map(|(_, p)| p.disarm())
-                                   .collect();
-
-        Barrier::new(&vec)
-    }
-
-    /// This is a non-blocking attempt to get a `Signal` from a `Select`
-    /// this will return a `Some(Signal)` if there is a pending `Signal`
-    /// in the select. Otherwise it will return `None`
-    pub fn try_next(&mut self) -> Option<Signal> {
-        let mut guard = self.inner.lock().unwrap();
-        if let Some(x) = guard.ready.pop() {
-            return Some(self.signals.remove(&x).map(|x| x.disarm()).unwrap());
-        }
-        None
-    }
-
-    /// Get the number of Signals being watched
-    pub fn len(&self) -> usize {
-        self.signals.len()
-    }
-}
-
-impl Iterator for Select {
-    type Item = Signal;
-
-    fn next(&mut self) -> Option<Signal> {
-        loop {
-            if self.signals.len() == 0 {
-                return None;
-            }
-
-            let pulse = {
-                let mut guard = self.inner.lock().unwrap();
-                while let Some(x) = guard.ready.pop() {
-                    if let Some(x) = self.signals.remove(&x) {
-                        return Some(x.disarm());
-                    }
-                }
-                let (pulse, t) = Signal::new();
-                guard.trigger = Some(t);
-                pulse
-            };
-            pulse.wait().unwrap();
-        }
-    }
-}
-
-impl Signals for Select {
-    fn signal(&self) -> Signal {
-        let (pulse, t) = Signal::new();
-        let mut guard = self.inner.lock().unwrap();
-        if guard.ready.len() == 0 {
-            guard.trigger = Some(t);
-        } else {
-            t.pulse();
-        }
-        pulse
-    }
-}
-
-/// `SelectMap` is a wrapper around a `Select` rather then use
-/// a unique id to find out what signal has been asserts, `SelectMap`
-/// will return an supplied object.
-pub struct SelectMap<T> {
-    select: Select,
-    items: HashMap<usize, T>,
-}
-
-impl<T> SelectMap<T> {
-    /// Create a new empty `SelectMap`
-    pub fn new() -> SelectMap<T> {
-        SelectMap {
-            select: Select::new(),
-            items: HashMap::new(),
-        }
-    }
-
-    /// Add a `Signal` and an associated value into the `SelectMap`
-    pub fn add(&mut self, signal: Signal, value: T) {
-        let id = self.select.add(signal);
-        self.items.insert(id, value);
-    }
-
-    /// This is a non-blocking attempt to get a `Signal` from a `SelectMap`
-    /// this will return a `Some((Signal, T))` if there is a pending `Signal`
-    /// in the select. Otherwise it will return `None`
-    pub fn try_next(&mut self) -> Option<(Signal, T)> {
-        self.select.try_next().map(|x| {
-            let id = x.id();
-            (x, self.items.remove(&id).unwrap())
-        })
-    }
-
-    /// Get the number of items in the `SelectMap`
-    pub fn len(&self) -> usize {
-        self.items.len()
-    }
-}
-
-impl<T> Iterator for SelectMap<T> {
-    type Item = (Signal, T);
-
-    fn next(&mut self) -> Option<(Signal, T)> {
-        self.select.next().map(|x| {
-            let id = x.id();
-            (x, self.items.remove(&id).unwrap())
-        })
-    }
-}
-
-impl<T> Signals for SelectMap<T> {
-    fn signal(&self) -> Signal {
-        self.select.signal()
-    }
-}
diff --git a/vendor/pulse/tests/barrier.rs b/vendor/pulse/tests/barrier.rs
deleted file mode 100644
index 0c2d1c2..0000000
--- a/vendor/pulse/tests/barrier.rs
+++ /dev/null
@@ -1,132 +0,0 @@
-//   Copyright 2015 Colin Sherratt
-//
-//   Licensed under the Apache License, Version 2.0 (the "License");
-//   you may not use this file except in compliance with the License.
-//   You may obtain a copy of the License at
-//
-//       http://www.apache.org/licenses/LICENSE-2.0
-//
-//   Unless required by applicable law or agreed to in writing, software
-//   distributed under the License is distributed on an "AS IS" BASIS,
-//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//   See the License for the specific language governing permissions and
-//   limitations under the License.
-
-extern crate pulse;
-
-use std::thread;
-use pulse::*;
-
-#[test]
-fn using_vec() {
-    let mut pulses = Vec::new();
-    let mut signals = Vec::new();
-    for _ in 0..8 {
-        let (p, t) = Signal::new();
-        pulses.push(p);
-        signals.push(t);
-    }
-
-    let barrier = Barrier::new(&pulses);
-    let pulse = barrier.signal();
-
-    let last_trigger = signals.pop().unwrap();
-    for t in signals {
-        t.pulse();
-        assert!(pulse.is_pending());
-    }
-
-    last_trigger.pulse();
-    assert!(!pulse.is_pending());
-}
-
-#[test]
-fn using_slice() {
-    let mut pulses = Vec::new();
-    let mut signals = Vec::new();
-    for _ in 0..8 {
-        let (p, t) = Signal::new();
-        pulses.push(p);
-        signals.push(t);
-    }
-
-    let barrier = Barrier::new(&pulses);
-    let pulse = barrier.signal();
-
-    let last_trigger = signals.pop().unwrap();
-    for t in signals {
-        t.pulse();
-        assert!(pulse.is_pending());
-    }
-
-    last_trigger.pulse();
-    assert!(!pulse.is_pending());
-}
-
-#[test]
-fn empty() {
-    let barrier = Barrier::new(&[]);
-    let pulse = barrier.signal();
-    assert!(!pulse.is_pending());
-}
-
-#[test]
-fn using_threads() {
-    let mut pulses = Vec::new();
-    let mut signals = Vec::new();
-    for _ in 0..8 {
-        let (p, t) = Signal::new();
-        pulses.push(p);
-        signals.push(t);
-    }
-
-    let barrier = Barrier::new(&pulses);
-    let pulse = barrier.signal();
-
-    thread::spawn(move || {
-        for t in signals {
-            t.pulse();
-        }
-    });
-
-    pulse.wait().unwrap();
-}
-
-#[test]
-fn dropped_barrier() {
-    let mut pulses = Vec::new();
-    let mut signals = Vec::new();
-    for _ in 0..8 {
-        let (p, t) = Signal::new();
-        pulses.push(p);
-        signals.push(t);
-    }
-
-    let pulse = {
-        let barrier = Barrier::new(&pulses);
-        barrier.signal()
-    };
-
-    let last_trigger = signals.pop().unwrap();
-    for t in signals {
-        t.pulse();
-        assert!(pulse.is_pending());
-    }
-
-    last_trigger.pulse();
-    assert!(!pulse.is_pending());   
-}
-
-#[test]
-fn barrier_clone() {
-    let (p, t) = Signal::new();
-    let p1 = p.clone();
-    let join = thread::spawn(move || {
-        p1.wait().unwrap();
-    });
-    thread::sleep_ms(10);
-    let barrier = Barrier::new(&[p]);
-    drop(barrier);
-    t.pulse();
-    join.join().unwrap();
-}
diff --git a/vendor/pulse/tests/select.rs b/vendor/pulse/tests/select.rs
deleted file mode 100644
index 8e401a3..0000000
--- a/vendor/pulse/tests/select.rs
+++ /dev/null
@@ -1,144 +0,0 @@
-//   Copyright 2015 Colin Sherratt
-//
-//   Licensed under the Apache License, Version 2.0 (the "License");
-//   you may not use this file except in compliance with the License.
-//   You may obtain a copy of the License at
-//
-//       http://www.apache.org/licenses/LICENSE-2.0
-//
-//   Unless required by applicable law or agreed to in writing, software
-//   distributed under the License is distributed on an "AS IS" BASIS,
-//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//   See the License for the specific language governing permissions and
-//   limitations under the License.
-
-
-extern crate pulse;
-
-use std::thread;
-use pulse::*;
-
-#[test]
-fn select_one() {
-    let (p, t) = Signal::new();
-    let mut select = Select::new();
-    let id = select.add(p);
-    t.pulse();
-    let p = select.next().unwrap();
-    assert_eq!(id, p.id());
-}
-
-#[test]
-fn select_three() {
-    let (p0, t0) = Signal::new();
-    let (p1, t1) = Signal::new();
-    let (p2, t2) = Signal::new();
-
-    let mut select = Select::new();
-    let id0 = select.add(p0);
-    let id1 = select.add(p1);
-    let id2 = select.add(p2);
-
-    t0.pulse();
-    let p = select.next().unwrap();
-    assert_eq!(id0, p.id());
-
-    t1.pulse();
-    let p = select.next().unwrap();
-    assert_eq!(id1, p.id());
-
-    t2.pulse();
-    let p = select.next().unwrap();
-    assert_eq!(id2, p.id());
-
-    let p = select.next();
-    assert!(p.is_none());
-}
-
-#[test]
-fn select_thread() {
-    let (p0, t0) = Signal::new();
-    let (p1, t1) = Signal::new();
-    let (p2, t2) = Signal::new();
-
-    let mut select = Select::new();
-    let id0 = select.add(p0);
-    let id1 = select.add(p1);
-    let id2 = select.add(p2);
-
-    thread::spawn(move || {
-        thread::sleep_ms(10);
-        t0.pulse();
-        thread::sleep_ms(10);
-        t1.pulse();
-        thread::sleep_ms(10);
-        t2.pulse();
-    });
-
-    let p = select.next().unwrap();
-    assert_eq!(id0, p.id());
-    let p = select.next().unwrap();
-    assert_eq!(id1, p.id());
-    let p = select.next().unwrap();
-    assert_eq!(id2, p.id());
-    let p = select.next();
-    assert!(p.is_none());
-}
-
-#[test]
-fn select_barrier() {
-    let (p0, t0) = Signal::new();
-    let (p1, t1) = Signal::new();
-    let (p2, t2) = Signal::new();
-
-    let mut select = Select::new();
-    let _ = select.add(p0);
-    let _ = select.add(p1);
-    let _ = select.add(p2);
-
-    thread::spawn(move || {
-        thread::sleep_ms(10);
-        t0.pulse();
-        thread::sleep_ms(10);
-        t1.pulse();
-        thread::sleep_ms(10);
-        t2.pulse();
-    });
-
-    select.into_barrier().signal().wait().unwrap();
-}
-
-#[test]
-fn select_already_pulsed() {
-    let (p0, t0) = Signal::new();
-    t0.pulse();
-
-    let mut select = Select::new();
-    let id0 = select.add(p0);
-
-    let p = select.next().unwrap();
-    assert_eq!(id0, p.id());
-    let p = select.next();
-    assert!(p.is_none());
-}
-
-#[test]
-fn select_remove() {
-    let (p0, t0) = Signal::new();
-    let (p1, t1) = Signal::new();
-
-    let mut select = Select::new();
-    let id0 = select.add(p0);
-    let id1 = select.add(p1);
-
-    thread::spawn(move || {
-        // This should only matter if the bug still exists
-        // this thread will otherwise unblock the select
-        thread::sleep_ms(100);
-        t1.pulse();
-    });
-
-    t0.pulse();
-    select.remove(id0).unwrap();
-    assert_eq!(id1, select.next().unwrap().id());
-}
diff --git a/vendor/pulse/tests/simple.rs b/vendor/pulse/tests/simple.rs
deleted file mode 100644
index c12f681..0000000
--- a/vendor/pulse/tests/simple.rs
+++ /dev/null
@@ -1,154 +0,0 @@
-//   Copyright 2015 Colin Sherratt
-//
-//   Licensed under the Apache License, Version 2.0 (the "License");
-//   you may not use this file except in compliance with the License.
-//   You may obtain a copy of the License at
-//
-//       http://www.apache.org/licenses/LICENSE-2.0
-//
-//   Unless required by applicable law or agreed to in writing, software
-//   distributed under the License is distributed on an "AS IS" BASIS,
-//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//   See the License for the specific language governing permissions and
-//   limitations under the License.
-
-
-
-extern crate pulse;
-extern crate atom;
-
-use std::thread;
-use pulse::*;
-use atom::*;
-
-#[test]
-fn wait() {
-    let (p, t) = Signal::new();
-    assert!(p.is_pending());
-    t.pulse();
-    assert!(!p.is_pending());
-}
-
-#[test]
-fn wake_post() {
-    let (p, t)  = Signal::new();
-    assert!(p.is_pending());
-    t.pulse();
-    assert!(!p.is_pending());
-    p.wait().unwrap();
-}
-
-#[test]
-fn wake_thread_spawn() {
-    let (p, t)  = Signal::new();
-    assert!(p.is_pending());
-    thread::spawn(|| {
-        thread::sleep_ms(10);
-        t.pulse();
-    });
-    assert!(p.is_pending());
-    p.clone().wait().unwrap();
-    assert!(!p.is_pending());
-}
-
-#[test]
-#[should_panic]
-fn dropped() {
-    let (p, t)  = Signal::new();
-    drop(t);
-    p.wait().unwrap();
-}
-
-#[test]
-#[should_panic]
-fn dropped_thread() {
-    let (p, t)  = Signal::new();
-    thread::spawn(|| {
-        thread::sleep_ms(10);
-        drop(t);
-    });
-    p.wait().unwrap();
-}
-
-#[test]
-fn false_positive_wake() {
-    let (p, t)  = Signal::new();
-    thread::current().unpark();
-    thread::spawn(|| {
-        thread::sleep_ms(10);
-        t.pulse();
-    });
-    p.wait().unwrap();
-}
-
-#[test]
-fn clone() {
-    let (p0, t) = Signal::new();
-    let p1 = p0.clone();
-
-    assert!(p0.is_pending());
-    assert!(p1.is_pending());
-    assert_eq!(p0.id(), p1.id());
-
-    t.pulse();
-
-    assert!(!p0.is_pending());
-    assert!(!p1.is_pending());
-
-    drop(p0);
-    assert!(!p1.is_pending());
-    drop(p1);
-}
-
-#[test]
-fn clone_wait() {
-    let (p0, t) = Signal::new();
-    let p1 = p0.clone();
-
-    let t0 = thread::spawn(move || {
-        p0.wait().unwrap();
-    });
-
-    let t1 = thread::spawn(move || {
-        p1.wait().unwrap();;
-    });
-
-    thread::sleep_ms(10);
-    t.pulse();
-    t0.join().unwrap();
-    t1.join().unwrap();
-}
-
-#[test]
-fn cast_to_usize() {
-    let (p, t) = Signal::new();
-
-    assert!(p.is_pending());
-    unsafe {
-        let us = t.cast_to_usize();
-        Pulse::cast_from_usize(us).pulse();
-    }
-    assert!(!p.is_pending());
-}
-
-#[test]
-fn into_raw() {
-    let (p, t)  = Signal::new();
-
-    assert!(p.is_pending());
-    unsafe {
-        let us = t.into_raw();
-        let t: Pulse = FromRawPtr::from_raw(us);
-        t.pulse();
-    }
-    assert!(p.wait().is_ok());
-}
-
-#[test]
-fn test_timeout() {
-    let (s, p) = Signal::new();
-
-    assert_eq!(s.clone().wait_timeout_ms(25), Err(TimeoutError::Timeout));
-    p.pulse();
-    assert_eq!(s.clone().wait_timeout_ms(25), Ok(()));
-}
diff --git a/vendor/timebomb/.cargo-checksum.json b/vendor/timebomb/.cargo-checksum.json
deleted file mode 100644
index d4d88ed..0000000
--- a/vendor/timebomb/.cargo-checksum.json
+++ /dev/null
@@ -1 +0,0 @@
-{"files":{".travis.yml":"d91d0d75087934c2d0503a8c04439fea459a19182021bb0b699644d442f5b6fc","Cargo.toml":"835c450dca8aedc50e8311c2934ae7ce772e8e718606d31343432e1724161321","LICENSE":"09e8a9bcec8067104652c168685ab0931e7868f9c8284b66f5ae6edae5f1130b","Readme.md":"b54e1b9e288b93df1a4e4e79e3c34f01114b197feb2555327f59e99d580a5bfd","src/lib.rs":"0d833511b8df2201462b58c69782197adc8651c257c92141ee549ead0b94050f"},"package":"7f0886f4b637067027d8c9a038a9249d95648689d1a91009d9abb895625f883a"}
\ No newline at end of file
diff --git a/vendor/timebomb/.travis.yml b/vendor/timebomb/.travis.yml
deleted file mode 100644
index 22761ba..0000000
--- a/vendor/timebomb/.travis.yml
+++ /dev/null
@@ -1 +0,0 @@
-language: rust
diff --git a/vendor/timebomb/Cargo.toml b/vendor/timebomb/Cargo.toml
deleted file mode 100644
index 7add915..0000000
--- a/vendor/timebomb/Cargo.toml
+++ /dev/null
@@ -1,11 +0,0 @@
-[package]
-name = "timebomb"
-version = "0.1.2"
-authors = ["Colin Sherratt <colin.sherratt@gmail.com>"]
-license = "Apache-2.0"
-homepage = "https://github.com/csherratt/timebomb"
-description = "A timeout mechnisem for unit tests"
-
-[dependencies]
-pulse = "*"
-time = "*"
\ No newline at end of file
diff --git a/vendor/timebomb/LICENSE b/vendor/timebomb/LICENSE
deleted file mode 100644
index 67db858..0000000
--- a/vendor/timebomb/LICENSE
+++ /dev/null
@@ -1,175 +0,0 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
diff --git a/vendor/timebomb/Readme.md b/vendor/timebomb/Readme.md
deleted file mode 100644
index 3adfa49..0000000
--- a/vendor/timebomb/Readme.md
+++ /dev/null
@@ -1,20 +0,0 @@
-Timebomb
-========
-
-[![Build Status](https://travis-ci.org/csherratt/timebomb.svg?branch=master)](https://travis-ci.org/csherratt/timebomb)
-
-This is a simple timeout mechanism for Rust that is intended for use with unit tests.
-
-```rust
-extern crate timebomb;
-use timebomb::timeout_ms;
-
-#[test]
-fn something_bad() {
-	// This will timeout in 1 second if the test did not pass
-	timeout_ms(|| {
-		// oops infinite loop
-		loop {}
-	}, 1000);
-}
-```
diff --git a/vendor/timebomb/src/lib.rs b/vendor/timebomb/src/lib.rs
deleted file mode 100644
index eed5df8..0000000
--- a/vendor/timebomb/src/lib.rs
+++ /dev/null
@@ -1,65 +0,0 @@
-//   Copyright 2015 Colin Sherratt
-//
-//   Licensed under the Apache License, Version 2.0 (the "License");
-//   you may not use this file except in compliance with the License.
-//   You may obtain a copy of the License at
-//
-//       http://www.apache.org/licenses/LICENSE-2.0
-//
-//   Unless required by applicable law or agreed to in writing, software
-//   distributed under the License is distributed on an "AS IS" BASIS,
-//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//   See the License for the specific language governing permissions and
-//   limitations under the License.
-
-extern crate pulse;
-
-use std::thread;
-use pulse::{Signal, TimeoutError};
-
-/// Run f for at most max_ms, this function will panic if
-/// f is still running.
-pub fn timeout_ms<F>(f: F, max_ms: u32) where F: FnOnce() + Send + 'static {
-    let (signal_start, pulse_start) = Signal::new();
-    let (signal_end, pulse_end) = Signal::new();
-
-    let guard = thread::spawn(|| {
-        pulse_start.pulse();
-        f();
-        pulse_end.pulse();
-    });
-
-    // Wait for the thread to start.
-    // This is done so that a loaded computer
-    // does not timeout before the thread has been started
-    signal_start.wait().unwrap();
-
-    // Wait for the timeout
-    match signal_end.wait_timeout_ms(max_ms) {
-        Err(TimeoutError::Timeout) => {
-            panic!("Timed out");
-        }
-        _ => ()
-    }
-
-    guard.join().unwrap();
-}
-
-#[test]
-fn timeout_ms_no_timeout_ms() {
-    timeout_ms(|| {}, 100);
-}
-
-#[test]
-#[should_panic]
-fn timeout_ms_spin() {
-    timeout_ms(|| loop {}, 100);
-}
-
-#[test]
-#[should_panic]
-fn child_panics() {
-    timeout_ms(|| {
-        panic!("oh no!")
-    }, 100);
-}
\ No newline at end of file