Simplify library interface and close #20