Add support for creating and opening libraries

The support is extremely limited at the moment, but its a start.

Signed-off-by: Alex Waterman <imNotListening@gmail.com>