Add git ignore and separate this to a library and a sample