First commit, it's working. Will clean up and provide encryption support