Add: Implemented more code that doesn't compile

More code added with functions and constants from Henrik's code as
well as more translations from our C-code. Will continue work next
week.