Lab as test library + some bug fixes

Closes #22