First code upload

Not tested much yet.