New library structure

- Use of opaque pointers for referencing the devices
- Hidden device implementation
- Added error signal as return from functions