Add platform library

Change-Id: Iacd0c6b4364b68848cca87149892544385ce9c2c
Reviewed-on: http://review.couchbase.org/27719
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Reviewed-by: Sriram Melkote <siri.couchbase@gmail.com>