Id length made global constant
Move set -u to inside "call as binary" block
Added is_id function
More tests added for existing functions