Add application structure and rudimentary input loop processes by @kaos

* Make the game as an Erlang application
* Separate the input loop process