Minor syntax changes
Move some functions to libsn