I am trying to visualise transactions for Ethereum, currently, I know there are blockchain explorers such as Etherscan.io and Etherchain.org, however I don't want to keep calling their API to get data, rather use my own full node to get all the data I require since it give me greater control.
So I set up a full node and use the Web3JS library to get blocks and transactions. However, the Web3JS doesn't have the option to get an account via given address (unless I am mistaken). So, once I have the transaction object, I can figure out who the sender and receiver are, but I also want to know whether the sender or receiver is a contract or an account. I know on etherchain's API we can get accounts using the address, is it possible to do the same using geth and Web3Js?
Ethereum's yellow paper mentions that each account has a nonce, balance, storageHash and codeHash, so I thought it would be possible to get an account using addresses from the blockchain. Please help we figure out how to determine whether a given address is a contract or an account, without using blockchain explorers mentioned above?