Bump version to 0.5.1
Fix tests, use local lib.