Add initial library code

Signed-off-by: Max Liao <maxliaops@gmail.com>