Docker API Parity - Support for Cpu Shares,Devices and Restart Policy

@ibuildthecloud - I just copy pasted the files from his repo :)
This is very minor, but I feel like down the line, the function names ```pre_failure`` and ```post_failure``` will mislead a developer to think this is checking some failure condition or case. Maybe ```pre_failure_policy`` or ```failure_policy_pre``` would be more clear? Try them out and see what fits best.