core code moved

stuck into a lib folder
Added license and credit info
added MIT licence